Пример #1
0
 public void TestComponentRemovedChecksWithAllFamilies()
 {
     _game.GetNodeList<MockNode>();
     _game.GetNodeList<MockNode2>();
     var entity = new Entity();
     _game.AddEntity(entity);
     entity.Add(new Point());
     entity.Remove<Point>();
     var results = new List<int>
     {
         MockFamily.Instances[0].ComponentRemovedCalls,
         MockFamily.Instances[1].ComponentRemovedCalls
     };
     Assert.AreEqual(new List<int> { 1, 1 }, results);
 }
Пример #2
0
 public void TestEntityRemovedFromFamilyWhenComponentRemovedAndFamilyNotAlreadyAccessed()
 {
     var entity = new Entity();
     entity.Add(new Vector2());
     entity.Add(new Matrix4x4());
     _game.AddEntity(entity);
     entity.Remove<Vector2>();
     var nodes = _game.GetNodeList<MockNode>();
     Assert.IsNull(nodes.Head);
 }
 public void TestEntityIsRemovedWhenComponentRemoved()
 {
     var entity = new Entity();
     entity.Add(new Point());
     _family.NewEntity(entity);
     entity.Remove(typeof(Point));
     _family.ComponentRemovedFromEntity(entity, typeof(Point));
     var nodes = _family.NodeList;
     Assert.IsNull(nodes.Head);
 }