Browse Source

improve EGID structure

tags/2.7
sebas77 5 years ago
parent
commit
e5814b6b3d
1 changed files with 19 additions and 1 deletions
  1. +19
    -1
      Svelto.ECS/EGID.cs

+ 19
- 1
Svelto.ECS/EGID.cs View File

@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;

namespace Svelto.ECS
{
public struct EGID
public struct EGID:IEquatable<long>,IEqualityComparer<long>
{
long _GID;
@@ -33,5 +36,20 @@ namespace Svelto.ECS
{
return (long)groupId << 32 | ((long)(uint)entityId & 0xFFFFFFFF);
}

public bool Equals(long other)
{
return _GID == other;
}

public bool Equals(long x, long y)
{
return x == y;
}

public int GetHashCode(long obj)
{
return _GID.GetHashCode();
}
}
}

Loading…
Cancel
Save