diff --git a/src/gaemstone.ECS/Entity.cs b/src/gaemstone.ECS/Entity.cs index 5117cc0..f9d5425 100644 --- a/src/gaemstone.ECS/Entity.cs +++ b/src/gaemstone.ECS/Entity.cs @@ -30,7 +30,7 @@ public unsafe readonly partial struct Entity public Entity? Parent => GetOrNull(World, GetTargets(FlecsBuiltIn.ChildOf).FirstOrDefault()); public IEnumerable> Children - => Iterator.FromTerm(World, new(FlecsBuiltIn.ChildOf, this)).GetAllEntities(); + => World.Term(new(FlecsBuiltIn.ChildOf, this)).GetAllEntities(); private Entity(World world, Entity value) diff --git a/src/gaemstone.ECS/World.cs b/src/gaemstone.ECS/World.cs index 3cdc8b1..c75fd22 100644 --- a/src/gaemstone.ECS/World.cs +++ b/src/gaemstone.ECS/World.cs @@ -60,6 +60,12 @@ public unsafe struct World => Pair(Entity(), Entity()); + public Iterator Term(Term term) => Iterator.FromTerm(this, term); + public Filter Filter(FilterDesc desc) => new(this, desc); + public Query Query(QueryDesc desc) => new(this, desc); + public Rule Rule(FilterDesc desc) => new(this, desc); + + public bool Equals(World other) => Value == other.Value; public override bool Equals(object? obj) => (obj is World other) && Equals(other); public override int GetHashCode() => Value.GetHashCode();