Entitas  0.40.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
EntityEqualityComparer.cs
1 using System.Collections.Generic;
2 
3 namespace Entitas {
4 
5  public class EntityEqualityComparer<TEntity> : IEqualityComparer<TEntity> where TEntity : class, IEntity, new() {
6 
7  public static readonly IEqualityComparer<TEntity> comparer = new EntityEqualityComparer<TEntity>();
8 
9  public bool Equals(TEntity x, TEntity y) {
10  return x == y;
11  }
12 
13  public int GetHashCode(TEntity obj) {
14  return obj.creationIndex;
15  }
16  }
17 }