diff --git a/src/gaemstone/ECS/EntityBuilder.cs b/src/gaemstone/ECS/EntityBuilder.cs index 682ca94..b04cd0a 100644 --- a/src/gaemstone/ECS/EntityBuilder.cs +++ b/src/gaemstone/ECS/EntityBuilder.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using gaemstone.Utility; using static flecs_hub.flecs; -using static flecs_hub.flecs.Runtime; namespace gaemstone.ECS; @@ -79,7 +78,6 @@ public class EntityBuilder public override EntityBuilder Set(T obj) { _toSet.Add(e => e.Set(obj)); return this; } - public static CString ETX { get; } = (CString)"\x3"; public unsafe EntityRef Build() { var parent = _parent; @@ -98,7 +96,7 @@ public class EntityBuilder symbol = alloc.AllocateCString(_symbol), add_expr = alloc.AllocateCString(Expression), use_low_id = UseLowID, - sep = ETX, // TODO: Replace with CStringExtensions.Empty once supported. + sep = CStringExtensions.ETX, }; var add = desc.add; var index = 0; diff --git a/src/gaemstone/ECS/EntityPath.cs b/src/gaemstone/ECS/EntityPath.cs index fc13787..54f9e32 100644 --- a/src/gaemstone/ECS/EntityPath.cs +++ b/src/gaemstone/ECS/EntityPath.cs @@ -124,7 +124,7 @@ public class EntityPath foreach (var part in path) fixed (byte* ptr = part.AsSpan()) if (skipLookup || (parent = new(ecs_lookup_child(universe, parent, ptr))).IsNone) { - var desc = new ecs_entity_desc_t { name = ptr }; + var desc = new ecs_entity_desc_t { name = ptr, sep = CStringExtensions.ETX }; if (parent.IsSome) desc.add[0] = Identifier.Pair(universe.ChildOf, parent); parent = new(ecs_entity_init(universe, &desc)); skipLookup = true; diff --git a/src/gaemstone/Utility/CStringExtensions.cs b/src/gaemstone/Utility/CStringExtensions.cs index acd63ac..46577ab 100644 --- a/src/gaemstone/Utility/CStringExtensions.cs +++ b/src/gaemstone/Utility/CStringExtensions.cs @@ -8,6 +8,7 @@ namespace gaemstone.Utility; public unsafe static class CStringExtensions { public static CString Empty { get; } = (CString)""; + public static CString ETX { get; } = (CString)"\x3"; // TODO: Temporary, until flecs supports Empty. public static unsafe byte[]? FlecsToBytes(this CString str) {