From 488cc38e6bd6d3ef6d48465756919724dada9c71 Mon Sep 17 00:00:00 2001 From: BeanCheeseBurrito Date: Sun, 17 Nov 2024 23:10:32 -0800 Subject: [PATCH] Update tests to use entity and id extensions --- .../CSharp/Core/QueryBuilderTests.cs | 10 ++- src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs | 16 ++-- src/Flecs.NET.Tests/Cpp/EntityTests.cs | 90 +++++++++---------- src/Flecs.NET.Tests/Cpp/ObserverTests.cs | 16 ++-- src/Flecs.NET.Tests/Cpp/PairTests.cs | 8 +- src/Flecs.NET.Tests/Cpp/QueryBuilderTests.cs | 16 ++-- src/Flecs.NET.Tests/Cpp/QueryTests.cs | 16 ++-- src/Flecs.NET.Tests/Cpp/SystemBuilderTests.cs | 2 +- src/Flecs.NET.Tests/Cpp/SystemTests.cs | 18 ++-- src/Flecs.NET.Tests/Cpp/TableTests.cs | 2 +- src/Flecs.NET.Tests/Cpp/UnionTests.cs | 8 +- src/Flecs.NET.Tests/Cpp/WorldFactoryTests.cs | 4 +- 12 files changed, 106 insertions(+), 100 deletions(-) diff --git a/src/Flecs.NET.Tests/CSharp/Core/QueryBuilderTests.cs b/src/Flecs.NET.Tests/CSharp/Core/QueryBuilderTests.cs index 28e63b69..de6c9134 100644 --- a/src/Flecs.NET.Tests/CSharp/Core/QueryBuilderTests.cs +++ b/src/Flecs.NET.Tests/CSharp/Core/QueryBuilderTests.cs @@ -92,16 +92,19 @@ private void TermAt() world.Component(); world.QueryBuilder() + .Cached() .With() .TermAt(0) .Build(); world.QueryBuilder() + .Cached() .With() .TermAt(0) .Build(); world.QueryBuilder() + .Cached() .With().Second() .TermAt(0) .Build(); @@ -109,6 +112,7 @@ private void TermAt() Assert.Throws(() => { world.QueryBuilder() + .Cached() .With().Second() .TermAt(0) .Build(); @@ -117,6 +121,7 @@ private void TermAt() Assert.Throws(() => { world.QueryBuilder() + .Cached() .With().Second() .TermAt(0) .Build(); @@ -124,14 +129,15 @@ private void TermAt() Assert.Throws(() => { - world.Component().Entity.Add(Ecs.PairIsTag); + world.Component().Add(Ecs.PairIsTag); world.QueryBuilder() + .Cached() .With() .TermAt(0) .Build(); - world.Component().Entity.Remove(Ecs.PairIsTag); + world.Component().Remove(Ecs.PairIsTag); }); } } diff --git a/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs b/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs index 2376b5ba..7ac6b603 100644 --- a/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs +++ b/src/Flecs.NET.Tests/CSharp/Core/QueryTests.cs @@ -821,7 +821,7 @@ private void EachSharedUnmanaged() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query query = world.Query(); @@ -848,7 +848,7 @@ private void EachSharedManaged() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query query = world.Query(); @@ -875,7 +875,7 @@ private void EachSparseUnmanaged() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); using Query query = world.Query(); @@ -902,7 +902,7 @@ private void EachSparseManaged() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); using Query query = world.Query(); @@ -929,8 +929,8 @@ private void EachSparseSharedUnmanaged() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.Sparse); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query query = world.Query(); @@ -960,8 +960,8 @@ private void EachSparseSharedManaged() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.Sparse); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query query = world.Query(); diff --git a/src/Flecs.NET.Tests/Cpp/EntityTests.cs b/src/Flecs.NET.Tests/Cpp/EntityTests.cs index 5b786bef..5132c1e2 100644 --- a/src/Flecs.NET.Tests/Cpp/EntityTests.cs +++ b/src/Flecs.NET.Tests/Cpp/EntityTests.cs @@ -787,7 +787,7 @@ private void AddRole() Entity entity = world.Entity(); - entity = entity.Id.AddFlags(ECS_PAIR); + entity = entity.AddFlags(ECS_PAIR); Assert.True((entity & ECS_PAIR) != 0); } @@ -801,11 +801,11 @@ private void RemoveRole() ulong id = entity; - entity = entity.Id.AddFlags(ECS_PAIR); + entity = entity.AddFlags(ECS_PAIR); Assert.True((entity & ECS_PAIR) != 0); - entity = entity.Id.RemoveFlags(); + entity = entity.RemoveFlags(); Assert.True(entity == id); } @@ -817,13 +817,13 @@ private void HasRole() Entity entity = world.Entity(); - entity = entity.Id.AddFlags(ECS_PAIR); + entity = entity.AddFlags(ECS_PAIR); - Assert.True(entity.Id.HasFlags(ECS_PAIR)); + Assert.True(entity.HasFlags(ECS_PAIR)); - entity = entity.Id.RemoveFlags(); + entity = entity.RemoveFlags(); - Assert.True(!entity.Id.HasFlags(ECS_PAIR)); + Assert.True(!entity.HasFlags(ECS_PAIR)); } [Fact] @@ -1171,8 +1171,8 @@ private void ForceOwned() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity prefab = world.Prefab() .Add() @@ -1193,8 +1193,8 @@ private void ForceOwned2() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity prefab = world.Prefab() .Add() @@ -1216,8 +1216,8 @@ private void ForceOwnedNested() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity prefab = world.Prefab() .Add() @@ -1243,7 +1243,7 @@ private void TagHasSizeZero() Component comp = world.Component(); - EcsComponent* ptr = comp.Entity.GetPtr(); + EcsComponent* ptr = comp.GetPtr(); Assert.Equal(0, ptr->size); Assert.Equal(0, ptr->alignment); } @@ -1307,7 +1307,7 @@ private void IsComponentEnabled() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity e = world.Entity() .Add(); @@ -1321,7 +1321,7 @@ private void IsEnabledComponentEnabled() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity e = world.Entity() .Add() @@ -1335,7 +1335,7 @@ private void IsDisabledComponentEnabled() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity e = world.Entity() .Add() @@ -1349,7 +1349,7 @@ private void IsPairEnabled() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity e = world.Entity() .Add(); @@ -1363,7 +1363,7 @@ private void IsEnabledPairEnabled() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity e = world.Entity() .Add() @@ -1377,7 +1377,7 @@ private void IsDisabledPairEnabled() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity e = world.Entity() .Add() @@ -1391,7 +1391,7 @@ private void IsPairEnabledWithIds() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity rel = world.Entity(); Entity tgtA = world.Entity(); @@ -1439,7 +1439,7 @@ private void IsPairEnabledWithTargetId() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity tgtA = world.Entity(); Entity tgtB = world.Entity(); @@ -1456,7 +1456,7 @@ private void IsEnabledPairEnabledWithTargetId() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity tgt = world.Entity(); @@ -1472,7 +1472,7 @@ private void IsDisabledPairEnabledWithTargetId() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.CanToggle); + world.Component().Add(Ecs.CanToggle); Entity tgt = world.Entity(); @@ -1536,7 +1536,7 @@ private void Override() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .AutoOverride(); @@ -1575,7 +1575,7 @@ private void OverridePairWithTargetId() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity tgtA = world.Entity(); Entity tgtB = world.Entity(); @@ -1621,7 +1621,7 @@ private void OverridePair() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .AutoOverride() @@ -1642,7 +1642,7 @@ private void SetOverride() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .SetAutoOverride(new Position(10, 20)); @@ -1668,7 +1668,7 @@ private void SetOverrideLValue() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Position plvalue = new Position(10, 20); @@ -1696,7 +1696,7 @@ private void SetOverridePair() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .SetAutoOverride(new Position(10, 20)); @@ -1722,7 +1722,7 @@ private void SetOverridePairWithTargetId() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity tgt = world.Entity(); @@ -1750,7 +1750,7 @@ private void SetOverridePairWithRelTag() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .SetAutoOverride(new Position(10, 20)); @@ -2498,7 +2498,7 @@ private void WithSelf() }); Component self = world.Component(); - Assert.True(!self.Entity.Has(tag)); + Assert.True(!self.Has(tag)); int count = 0; using Query query = world.QueryBuilder() @@ -2533,7 +2533,7 @@ private void WithRelationTypeSelf() }); Component self = world.Component(); - Assert.True(!self.Entity.Has(bob)); + Assert.True(!self.Has(bob)); int count = 0; using Query q = world.QueryBuilder() @@ -2570,7 +2570,7 @@ private void WithRelationSelf() }); Component self = world.Component(); - Assert.True(!self.Entity.Has(likes, bob)); + Assert.True(!self.Has(likes, bob)); int count = 0; using Query q = world.QueryBuilder() @@ -2662,7 +2662,7 @@ private void WithScope() Assert.True(world.Lookup("P.C3") == parent.Lookup("C3")); Component self = world.Component(); - Assert.True(!self.Entity.Has(Ecs.ChildOf, parent)); + Assert.True(!self.Has(Ecs.ChildOf, parent)); int count = 0; using Query q = world.QueryBuilder() @@ -3752,7 +3752,7 @@ private void IdGetEntity() Id id = world.Id(e); - Assert.True(id.Entity() == e); + Assert.True(id.ToEntity() == e); } [Fact] @@ -4306,7 +4306,7 @@ private void AddIfExclusiveRo() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Exclusive); + world.Component().Add(Ecs.Exclusive); Entity e = world.Entity(); Entity o1 = world.Entity(); @@ -4329,7 +4329,7 @@ private void AddIfExclusiveRO() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Exclusive); + world.Component().Add(Ecs.Exclusive); Entity e = world.Entity(); @@ -4469,7 +4469,7 @@ private void GetDepthWithType() { using World world = World.Create(); - world.Component().Entity.Add(EcsTraversable); + world.Component().Add(EcsTraversable); Entity e1 = world.Entity(); Entity e2 = world.Entity().Add(e1); @@ -4595,7 +4595,7 @@ private void SetSparse() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); Entity e = world.Entity().Set(new Velocity(1, 2)); @@ -4611,7 +4611,7 @@ private void Insert1Sparse() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); Entity e = world.Entity().Insert((ref Velocity v) => { @@ -4632,7 +4632,7 @@ private void Insert2With1Sparse() using World world = World.Create(); world.Component(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); Entity e = world.Entity().Insert((ref Position p, ref Velocity v) => { @@ -4659,7 +4659,7 @@ private void OverrideSparse() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); Entity @base = world.Entity().Set(new Velocity(1, 2)); @@ -4678,7 +4678,7 @@ private void DeleteWithOverrideSparse() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); Entity @base = world.Entity().Set(new Velocity(1, 2)); diff --git a/src/Flecs.NET.Tests/Cpp/ObserverTests.cs b/src/Flecs.NET.Tests/Cpp/ObserverTests.cs index 67dac636..8fcc1412 100644 --- a/src/Flecs.NET.Tests/Cpp/ObserverTests.cs +++ b/src/Flecs.NET.Tests/Cpp/ObserverTests.cs @@ -971,7 +971,7 @@ private void OnSetWithSetSetSparse() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); int count = 0; @@ -1387,7 +1387,7 @@ private void OnAddInherited() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); int count = 0; Entity matched = default; @@ -1415,7 +1415,7 @@ private void OnSetInherited() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); int count = 0; Entity matched = default; @@ -1443,7 +1443,7 @@ private void OnRemoveInherited() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); int count = 0; Entity matched = default; @@ -1474,7 +1474,7 @@ private void OnSetAfterRemoveOverride() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Prefab() .Set(new Position(1, 2)); @@ -1505,7 +1505,7 @@ private void OnSetAfterRemoveOverrideCreateObserverBefore() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); int count = 0; @@ -1536,7 +1536,7 @@ private void OnSetWithOverrideAfterDelete() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Prefab() .Set(new Position(1, 2)); @@ -1563,7 +1563,7 @@ private void OnSetWithOverrideAfterClear() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Prefab() .Set(new Position(1, 2)); diff --git a/src/Flecs.NET.Tests/Cpp/PairTests.cs b/src/Flecs.NET.Tests/Cpp/PairTests.cs index aa723a18..8dcf75cf 100644 --- a/src/Flecs.NET.Tests/Cpp/PairTests.cs +++ b/src/Flecs.NET.Tests/Cpp/PairTests.cs @@ -232,7 +232,7 @@ private void OverridePair() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .Set(new Pair { Value = 10 }); @@ -1015,7 +1015,7 @@ private void GetObjectForTypeSelf() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity().Add(); Entity self = world.Entity().IsA(@base).Add(); @@ -1030,7 +1030,7 @@ private void GetObjectForTypeBase() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity().Add(); Entity self = world.Entity().IsA(@base); @@ -1101,7 +1101,7 @@ private void SymmetricWithChildOf() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Symmetric); + world.Component().Add(Ecs.Symmetric); Entity idk = world.Entity("Idk"); diff --git a/src/Flecs.NET.Tests/Cpp/QueryBuilderTests.cs b/src/Flecs.NET.Tests/Cpp/QueryBuilderTests.cs index 77c64c0b..07e0ea4a 100644 --- a/src/Flecs.NET.Tests/Cpp/QueryBuilderTests.cs +++ b/src/Flecs.NET.Tests/Cpp/QueryBuilderTests.cs @@ -1166,7 +1166,7 @@ private void IsASupersetTerm(ecs_query_cache_kind_t cacheKind) { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query q = world.QueryBuilder() .With().Src().Up(Ecs.IsA).In() @@ -1210,7 +1210,7 @@ private void IsASelfSupersetTerm(ecs_query_cache_kind_t cacheKind) { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query q = world.QueryBuilder() .With().Src().Self().Up(Ecs.IsA).In() @@ -1364,7 +1364,7 @@ private void IsASupersetTermWithEach(ecs_query_cache_kind_t cacheKind) { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query q = world.QueryBuilder() .TermAt(1).Src().Up(Ecs.IsA) @@ -1398,7 +1398,7 @@ private void IsASelfSupersetTermWithEach(ecs_query_cache_kind_t cacheKind) { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query q = world.QueryBuilder() .TermAt(1).Src().Self().Up(Ecs.IsA) @@ -1504,7 +1504,7 @@ private void IsASupersetShortcut(ecs_query_cache_kind_t cacheKind) { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query q = world.QueryBuilder() .TermAt(1).Up(Ecs.IsA) @@ -1538,7 +1538,7 @@ private void IsASupersetShortcutWithSelf(ecs_query_cache_kind_t cacheKind) { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); using Query q = world.QueryBuilder() .TermAt(1).Self().Up(Ecs.IsA) @@ -3093,7 +3093,7 @@ private void UpWithType(ecs_query_cache_kind_t cacheKind) using World world = World.Create(); - world.Component().Entity.Add(Ecs.Traversable); + world.Component().Add(Ecs.Traversable); using Query q = world.QueryBuilder() .With().Src().Up().In() @@ -3138,7 +3138,7 @@ private void CascadeWithType(ecs_query_cache_kind_t cacheKind) using World world = World.Create(); - world.Component().Entity.Add(Ecs.Traversable); + world.Component().Add(Ecs.Traversable); Entity tag = world.Entity(); Entity foo = world.Entity(); diff --git a/src/Flecs.NET.Tests/Cpp/QueryTests.cs b/src/Flecs.NET.Tests/Cpp/QueryTests.cs index 18e796b2..246b4e13 100644 --- a/src/Flecs.NET.Tests/Cpp/QueryTests.cs +++ b/src/Flecs.NET.Tests/Cpp/QueryTests.cs @@ -638,8 +638,8 @@ private void RunShared() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .Set(new Velocity(1, 2)); @@ -762,7 +762,7 @@ private void RunSparse() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); world.Component(); Entity entity = world.Entity() @@ -951,7 +951,7 @@ private void EachSparse() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Sparse); + world.Component().Add(Ecs.Sparse); world.Component(); Entity entity = world.Entity() @@ -1044,8 +1044,8 @@ private void SignatureShared() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .Set(new Velocity(1, 2)); @@ -1320,7 +1320,7 @@ private void ExprWithTemplate() using World world = World.Create(); Component> comp = world.Component>(); - Assert.Equal("Template", comp.Entity.Name()); + Assert.Equal("Template", comp.Name()); int count = 0; using Query q = world.QueryBuilder().Expr("Template").Build(); @@ -1350,7 +1350,7 @@ private void QueryTypeWithTemplate() using World world = World.Create(); Component> comp = world.Component>(); - Assert.Equal("Template", comp.Entity.Name()); + Assert.Equal("Template", comp.Name()); int count = 0; using Query> q = world.Query>(); diff --git a/src/Flecs.NET.Tests/Cpp/SystemBuilderTests.cs b/src/Flecs.NET.Tests/Cpp/SystemBuilderTests.cs index fe1ec7b4..d6c214d3 100644 --- a/src/Flecs.NET.Tests/Cpp/SystemBuilderTests.cs +++ b/src/Flecs.NET.Tests/Cpp/SystemBuilderTests.cs @@ -473,7 +473,7 @@ private void NameArg() } }); - Assert.True(s.Entity.Has()); + Assert.True(s.Has()); } [Fact] diff --git a/src/Flecs.NET.Tests/Cpp/SystemTests.cs b/src/Flecs.NET.Tests/Cpp/SystemTests.cs index f1f6ab23..c5ca2fb2 100644 --- a/src/Flecs.NET.Tests/Cpp/SystemTests.cs +++ b/src/Flecs.NET.Tests/Cpp/SystemTests.cs @@ -92,8 +92,8 @@ private void IterShared() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .Set(new Velocity(1, 2)); @@ -422,8 +422,8 @@ private void SignatureShared() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); - world.Component().Entity.Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); + world.Component().Add(Ecs.OnInstantiate, Ecs.Inherit); Entity @base = world.Entity() .Set(new Velocity(1, 2)); @@ -575,7 +575,7 @@ private void NestedSystem() } }); - Assert.Equal("bar", system1.Entity.Name()); + Assert.Equal("bar", system1.Name()); Entity e = world.Lookup("foo"); Assert.True(e.Id != 0); @@ -1395,7 +1395,7 @@ private void CustomPipeline() count++; } }) - .Entity.Add(tag); + .Add(tag); world.System() .Kind(onFrame) @@ -1407,7 +1407,7 @@ private void CustomPipeline() count++; } }) - .Entity.Add(tag); + .Add(tag); world.System() .Kind(preFrame) @@ -1419,7 +1419,7 @@ private void CustomPipeline() count++; } }) - .Entity.Add(tag); + .Add(tag); Assert.Equal(0, count); @@ -2242,7 +2242,7 @@ private void IntervalTickSource() TimerEntity t = world.Timer().Interval(2.1f); - ref EcsTimer timer = ref t.Entity.Ensure(); + ref EcsTimer timer = ref t.Ensure(); timer.time = 0; int sysAInvoked = 0, sysBInvoked = 0; diff --git a/src/Flecs.NET.Tests/Cpp/TableTests.cs b/src/Flecs.NET.Tests/Cpp/TableTests.cs index c24c34d4..e3c8345c 100644 --- a/src/Flecs.NET.Tests/Cpp/TableTests.cs +++ b/src/Flecs.NET.Tests/Cpp/TableTests.cs @@ -572,7 +572,7 @@ private void GetDepthWithType() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Traversable); + world.Component().Add(Ecs.Traversable); Entity e1 = world.Entity(); Entity e2 = world.Entity().Add(e1); diff --git a/src/Flecs.NET.Tests/Cpp/UnionTests.cs b/src/Flecs.NET.Tests/Cpp/UnionTests.cs index ede68348..c2681768 100644 --- a/src/Flecs.NET.Tests/Cpp/UnionTests.cs +++ b/src/Flecs.NET.Tests/Cpp/UnionTests.cs @@ -48,7 +48,7 @@ private void AddCaseWithType() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Union); + world.Component().Add(Ecs.Union); Entity e = world.Entity().Add(); Assert.True((e.Has())); @@ -64,7 +64,7 @@ private void AddSwitchWithType() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Union); + world.Component().Add(Ecs.Union); Entity e = world.Entity().Add(); Assert.True((e.Has())); @@ -80,7 +80,7 @@ private void AddRemoveSwitchWithType() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Union); + world.Component().Add(Ecs.Union); Entity e = world.Entity().Add(); Assert.True(e.Has(Ecs.Wildcard)); @@ -109,7 +109,7 @@ private void SwitchEnumType() { using World world = World.Create(); - world.Component().Entity.Add(Ecs.Union); + world.Component().Add(Ecs.Union); Entity e = world.Entity().Add(Color.Red); Assert.True(e.Has(Color.Red)); diff --git a/src/Flecs.NET.Tests/Cpp/WorldFactoryTests.cs b/src/Flecs.NET.Tests/Cpp/WorldFactoryTests.cs index d882b97f..32ee86df 100644 --- a/src/Flecs.NET.Tests/Cpp/WorldFactoryTests.cs +++ b/src/Flecs.NET.Tests/Cpp/WorldFactoryTests.cs @@ -92,7 +92,7 @@ private void SystemWithName() }); Assert.True(system.Id != 0); - Assert.Equal("MySystem", system.Entity.Name()); + Assert.Equal("MySystem", system.Name()); Entity e = world.Entity() .Set(new Position { X = 10, Y = 20 }) @@ -131,7 +131,7 @@ private void SystemWithExpr() }); Assert.True(system.Id != 0); - Assert.Equal("MySystem", system.Entity.Name()); + Assert.Equal("MySystem", system.Name()); Entity e = world.Entity() .Set(new Position { X = 10, Y = 20 })