Add Entity.ID and EntityRef.ID

wip/source-generators
copygirl 2 years ago
parent f399da3cf0
commit 14a70f5038
  1. 1
      src/gaemstone/ECS/Entity.cs
  2. 1
      src/gaemstone/ECS/EntityRef.cs

@ -39,6 +39,7 @@ public readonly struct Entity
public static readonly Entity None = default;
public readonly ecs_entity_t Value;
public uint ID => (uint)Value.Data;
public bool IsSome => Value.Data != 0;
public bool IsNone => Value.Data == 0;

@ -12,6 +12,7 @@ public unsafe sealed class EntityRef
{
public override Universe Universe { get; }
public Entity Entity { get; }
public uint ID => Entity.ID;
public bool IsValid => ecs_is_valid(Universe, this);
public bool IsAlive => ecs_is_alive(Universe, this);

Loading…
Cancel
Save