diff --git a/src/gaemstone.ECS/IdRef.cs b/src/gaemstone.ECS/IdRef.cs index 2115a70..1099c49 100644 --- a/src/gaemstone.ECS/IdRef.cs +++ b/src/gaemstone.ECS/IdRef.cs @@ -26,14 +26,20 @@ public unsafe class IdRef public static IdRef Pair(World world, Entity relation, Entity target) => new(world, Id.Pair(relation, target)); - public static IdRef Pair(EntityRef relation, EntityRef target) - => Pair(relation.World, relation, target); - public static IdRef Pair(EntityRef relation, Entity target) - => Pair(relation.World, relation, target); public static IdRef Pair(Entity relation, EntityRef target) => Pair(target.World, relation, target); + public static IdRef Pair(EntityRef relation, Entity target) + => Pair(relation.World, relation, target); + public static IdRef Pair(EntityRef relation, EntityRef target) + => Pair(relation.World, relation, target); + + public static IdRef Pair(World world, Entity target) + => Pair(world, world.LookupByTypeOrThrow(), target); public static IdRef Pair(EntityRef target) => Pair(target.World.LookupByTypeOrThrow(), target); + public static IdRef Pair(World world) + => Pair(world, world.LookupByTypeOrThrow(), + world.LookupByTypeOrThrow()); public EntityRef? AsEntity() => (Flags == default) ? World.LookupAlive(new Entity(new() { Data = Id })) : null;