MoonTools.ECS/src/Entity.cs

30 lines
445 B
C#

using System;
namespace MoonTools.ECS
{
public struct Entity : IEquatable<Entity>
{
public int ID { get; }
internal Entity(int id)
{
ID = id;
}
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;
}
}
}