diff --git a/src/gaemstone.ECS/IdentifierRef.cs b/src/gaemstone.ECS/IdentifierRef.cs index ba48a68..adaf549 100644 --- a/src/gaemstone.ECS/IdentifierRef.cs +++ b/src/gaemstone.ECS/IdentifierRef.cs @@ -21,10 +21,17 @@ public unsafe class IdentifierRef public static IdentifierRef Combine(IdentifierFlags flags, IdentifierRef id) => new(id.World, Identifier.Combine(flags, id)); + + public static IdentifierRef Pair(World world, Entity relation, Entity target) + => new(world, Identifier.Pair(relation, target)); + public static IdentifierRef Pair(EntityRef relation, EntityRef target) + => Pair(relation.World, relation, target); public static IdentifierRef Pair(EntityRef relation, Entity target) - => new(relation.World, Identifier.Pair(relation, target)); + => Pair(relation.World, relation, target); public static IdentifierRef Pair(Entity relation, EntityRef target) - => new(target.World, Identifier.Pair(relation, target)); + => Pair(target.World, relation, target); + public static IdentifierRef Pair(EntityRef target) + => Pair(target.World.LookupByTypeOrThrow(), target); public EntityRef? AsEntity() => (Flags == default) ? World.LookupAlive(new Entity(new() { Data = Id })) : null;