23 lines
555 B
C#
23 lines
555 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace GameCore.ECS;
|
|
|
|
/// <summary>
|
|
/// Represents a unique object in the game world.
|
|
/// It's a simple struct containing an ID to keep it lightweight.
|
|
/// All data associated with an Entity is stored in Components.
|
|
/// </summary>
|
|
public readonly struct Entity(int id)
|
|
{
|
|
public readonly int Id = id;
|
|
|
|
public override bool Equals([NotNullWhen(true)] object? obj)
|
|
{
|
|
return base.Equals(obj);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return Id.GetHashCode();
|
|
}
|
|
} |