From 8097f233ff4680a2d3a7a31c0d7856bff19c8a69 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 27 Dec 2022 17:48:45 +0100 Subject: [PATCH] Entity.None.ToString() returns "Entity.None" --- src/gaemstone.ECS/Entity.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gaemstone.ECS/Entity.cs b/src/gaemstone.ECS/Entity.cs index 345a1be..5eef0d9 100644 --- a/src/gaemstone.ECS/Entity.cs +++ b/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);