Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.0KB

  1. namespace Svelto.ECS
  2. {
  3. /// <summary>
  4. /// still experimental alternative to ExclusiveGroup, use this like:
  5. /// use this like:
  6. /// public class TriggersGroup : ExclusiveGroup<TriggersGroup> {}
  7. /// </summary>
  8. /// <typeparam name="T"></typeparam>
  9. public abstract class NamedExclusiveGroup<T>
  10. {
  11. public static ExclusiveGroup Group = new ExclusiveGroup();
  12. public static string name = typeof(T).FullName;
  13. static NamedExclusiveGroup()
  14. {
  15. #if DEBUG
  16. GroupNamesMap.idToName[Group] = $"{name} ID {Group.id}";
  17. #endif
  18. //The hashname is independent from the actual group ID. this is fundamental because it is want
  19. //guarantees the hash to be the same across different machines
  20. GroupHashMap.RegisterGroup(Group, $"{name}");
  21. }
  22. // protected NamedExclusiveGroup(string recognizeAs) : base(recognizeAs) {}
  23. // protected NamedExclusiveGroup(ushort range) : base(range) {}
  24. }
  25. }