diff --git a/Svelto.ECS/EGID.cs b/Svelto.ECS/EGID.cs index 0930987..8e3272d 100644 --- a/Svelto.ECS/EGID.cs +++ b/Svelto.ECS/EGID.cs @@ -13,9 +13,9 @@ namespace Svelto.ECS get { return (int) (_GID & 0xFFFFFFFF); } } - public int groupID + public ExclusiveGroup.ExclusiveGroupStruct groupID { - get { return (int) (_GID >> 32); } + get { return new ExclusiveGroup.ExclusiveGroupStruct((int) (_GID >> 32)); } } public static bool operator ==(EGID obj1, EGID obj2) diff --git a/Svelto.ECS/ExclusiveGroups.cs b/Svelto.ECS/ExclusiveGroups.cs index d8ac704..2d57ea7 100644 --- a/Svelto.ECS/ExclusiveGroups.cs +++ b/Svelto.ECS/ExclusiveGroups.cs @@ -100,6 +100,11 @@ namespace Svelto.ECS DBC.ECS.Check.Require(_globalId + range < ushort.MaxValue, "too many exclusive groups created"); _globalId += range; } + + internal ExclusiveGroupStruct(int groupID) + { + _id = groupID; + } public static implicit operator int(ExclusiveGroupStruct groupStruct) {