当前位置: 首页>>代码示例>>C#>>正文


C# EntityWorld.DeleteEntity方法代码示例

本文整理汇总了C#中Artemis.EntityWorld.DeleteEntity方法的典型用法代码示例。如果您正苦于以下问题:C# EntityWorld.DeleteEntity方法的具体用法?C# EntityWorld.DeleteEntity怎么用?C# EntityWorld.DeleteEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Artemis.EntityWorld的用法示例。


在下文中一共展示了EntityWorld.DeleteEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestUniqueId

 public void TestUniqueId()
 {
     Debug.WriteLine("Initialize EntityWorld: ");
     EntityWorld entityWorld = new EntityWorld();
     entityWorld.SystemManager.SetSystem(new TestCommunicationSystem(), GameLoopType.Update);
     entityWorld.InitializeAll();
     Debug.WriteLine("OK");
     Entity ent1 = TestEntityFactory.CreateTestHealthEntityWithId(entityWorld, -5);
     Debug.WriteLine("ID1 " + ent1.UniqueId);
     Debug.Assert(ent1.UniqueId == -5, "Ids dont match");
     Entity ent2 = TestEntityFactory.CreateTestHealthEntity(entityWorld);
     Debug.WriteLine("ID2 " + ent2.UniqueId);
     Debug.Assert(ent2.UniqueId != -5 && ent2.UniqueId > 0, "Ids cant match");
     Entity entrec = entityWorld.EntityManager.GetEntityByUniqueId(-5);
     Debug.Assert(ent1 == entrec, "Entities must match");
     entrec = entityWorld.EntityManager.GetEntity(ent1.Id);
     Debug.Assert(ent1 == entrec, "Entities must match");
     entityWorld.DeleteEntity(ent1);
     entityWorld.Update();
     entrec = entityWorld.EntityManager.GetEntityByUniqueId(-5);
     Debug.Assert(entrec == null, "Entity must be null");
     entrec = entityWorld.EntityManager.GetEntity(ent1.Id);
     Debug.Assert(entrec == null, "Entity must be null");
     Debug.WriteLine("OK");
 }
开发者ID:GrafSeismo,项目名称:artemis_CSharp,代码行数:25,代码来源:TestGeneral.cs

示例2: TestUniqId

 public void TestUniqId()
 {
     global::System.Diagnostics.Debug.WriteLine("Initialize EntityWorld: ");
     EntityWorld entityWorld = new EntityWorld();
     entityWorld.SystemManager.SetSystem(new TestCommunicationSystem(), GameLoopType.Update);
     #if !FULLDOTNET && !METRO
     entityWorld.InitializeAll();
     #else
     entityWorld.InitializeAll(false);
     #endif
     global::System.Diagnostics.Debug.WriteLine("OK");
     var ent1 = TestEntityFactory.CreateTestHealthEntityWithID(entityWorld, -5);
     global::System.Diagnostics.Debug.WriteLine("ID1 " + ent1.UniqueId );
     Debug.Assert(ent1.UniqueId == -5, "Ids dont match");
     var ent2 = TestEntityFactory.CreateTestHealthEntity(entityWorld);
     global::System.Diagnostics.Debug.WriteLine("ID2 " + ent2.UniqueId);
     Debug.Assert(ent2.UniqueId != -5 && ent2.UniqueId > 0, "Ids cant match");
     var entrec = entityWorld.EntityManager.GetEntityByUniqueID(-5);
     Debug.Assert(ent1 == entrec, "Entities must match");
     entrec = entityWorld.EntityManager.GetEntity(ent1.Id);
     Debug.Assert(ent1 == entrec, "Entities must match");
     entityWorld.DeleteEntity(ent1);
     entityWorld.Update();
     entrec = entityWorld.EntityManager.GetEntityByUniqueID(-5);
     Debug.Assert(entrec==null, "Entity must be null");
     entrec = entityWorld.EntityManager.GetEntity(ent1.Id);
     Debug.Assert(entrec == null, "Entity must be null");
     global::System.Diagnostics.Debug.WriteLine("OK");
 }
开发者ID:BaconSoap,项目名称:artemis_CSharp,代码行数:29,代码来源:TestGeneral.cs


注:本文中的Artemis.EntityWorld.DeleteEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。