Browse Source

added option to return an exclusivegroup from egid

tags/2.7
sebas77 5 years ago
parent
commit
bc90842a3a
2 changed files with 7 additions and 2 deletions
  1. +2
    -2
      Svelto.ECS/EGID.cs
  2. +5
    -0
      Svelto.ECS/ExclusiveGroups.cs

+ 2
- 2
Svelto.ECS/EGID.cs View File

@@ -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)


+ 5
- 0
Svelto.ECS/ExclusiveGroups.cs View File

@@ -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)
{


Loading…
Cancel
Save