Mirror of Svelto.ECS because we're a fan of it
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

32 lignes
950B

  1. using System;
  2. using Svelto.DataStructures;
  3. namespace Svelto.ECS
  4. {
  5. // This is just an opaque struct to identify filter collections.
  6. public struct EntityFilterID : IEquatable<EntityFilterID>
  7. {
  8. internal EntityFilterID(uint filterID, RefWrapperType componentType)
  9. {
  10. _filterID = filterID;
  11. _componentType = componentType;
  12. _hashCode = (int)filterID + (int)filterID ^ componentType.GetHashCode();
  13. }
  14. public bool Equals(EntityFilterID other)
  15. {
  16. return _filterID == other._filterID && _componentType.Equals(other._componentType);
  17. }
  18. public override bool Equals(object obj)
  19. {
  20. throw new NotImplementedException();
  21. }
  22. public override int GetHashCode() => _hashCode;
  23. readonly uint _filterID;
  24. readonly RefWrapperType _componentType;
  25. readonly int _hashCode;
  26. }
  27. }