Entity.None.ToString() returns "Entity.None"

wip/bindgen
copygirl 1 year ago
parent b6af74511f
commit 8097f233ff
  1. 4
      src/gaemstone.ECS/Entity.cs

@ -19,7 +19,9 @@ public readonly struct Entity
public bool Equals(Entity other) => Value.Data == other.Value.Data;
public override bool Equals(object? obj) => (obj is Entity other) && Equals(other);
public override int GetHashCode() => Value.Data.GetHashCode();
public override string? ToString() => $"Entity(0x{Value.Data.Data:X})";
public override string? ToString()
=> IsSome ? $"Entity(0x{Value.Data.Data:X})"
: "Entity.None";
public static bool operator ==(Entity left, Entity right) => left.Equals(right);
public static bool operator !=(Entity left, Entity right) => !left.Equals(right);

Loading…
Cancel
Save