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.

20 lines
675B

  1. namespace Svelto.ECS
  2. {
  3. public readonly struct CombinedFilterID
  4. {
  5. internal readonly long id;
  6. public FilterContextID contextID => new FilterContextID((uint)((id & 0xFFFF0000) >> 16));
  7. public uint filterID => (uint)(id >> 32);
  8. public CombinedFilterID(int filterID, FilterContextID contextID)
  9. {
  10. id = (long)filterID << 32 | (uint)contextID.id << 16;
  11. }
  12. public static implicit operator CombinedFilterID((int filterID, FilterContextID contextID) data)
  13. {
  14. return new CombinedFilterID(data.filterID, data.contextID);
  15. }
  16. }
  17. }