2022-03-05 02:01:44 +00:00
|
|
|
|
namespace MoonTools.ECS;
|
|
|
|
|
|
2022-03-31 21:51:43 +00:00
|
|
|
|
public struct Entity : IEquatable<Entity>
|
2022-03-05 02:01:44 +00:00
|
|
|
|
{
|
|
|
|
|
public int ID { get; }
|
|
|
|
|
|
|
|
|
|
internal Entity(int id)
|
|
|
|
|
{
|
|
|
|
|
ID = id;
|
|
|
|
|
}
|
2022-03-31 21:51:43 +00:00
|
|
|
|
|
|
|
|
|
public override bool Equals(object? obj)
|
|
|
|
|
{
|
|
|
|
|
return obj is Entity entity && Equals(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return HashCode.Combine(ID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Equals(Entity other)
|
|
|
|
|
{
|
|
|
|
|
return ID == other.ID;
|
|
|
|
|
}
|
2022-03-05 02:01:44 +00:00
|
|
|
|
}
|