本文整理汇总了C#中MatchState.AddEntity方法的典型用法代码示例。如果您正苦于以下问题:C# MatchState.AddEntity方法的具体用法?C# MatchState.AddEntity怎么用?C# MatchState.AddEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatchState
的用法示例。
在下文中一共展示了MatchState.AddEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestStateClone
public void TestStateClone()
{
MatchState state = new MatchState(new PhysicsEngine(new GameWorld(null)));
IEntity e = new IEntity(IDGenerator.GenerateID(), new Vec2(100f, -99f), 1f, 1f, 1f);
state.AddEntity(e);
Assert.True(state.ContainsEntity(e.ID), "entity1 added to match");
IEntity e2 = new IEntity(IDGenerator.GenerateID(), new Vec2(42f, 24f), 1f, 1f, 1f);
state.AddEntity(e2);
Assert.True(state.ContainsEntity(e2.ID), "entity2 added to match");
MatchState clone = state.Clone() as MatchState;
Assert.True(clone.ContainsEntity(e.ID), "clone contains entity1");
Assert.True(clone.ContainsEntity(e2.ID), "clone contains entity2");
IEntity clonedE = clone.GetEntity(e.ID);
TestClonedEntityValues(e, clonedE, true, "after clone (e1)");
ChangeClonedEntity(clonedE, new Vec2(11f, 111f), new Vec2(22f, 222f), 1000f, 2000f, 333f);
TestClonedEntityValues(e, clonedE, false, "after clone modif (e1)");
IEntity clonedE2 = clone.GetEntity(e2.ID);
TestClonedEntityValues(e2, clonedE2, true, "after clone (e2)");
ChangeClonedEntity(clonedE2, new Vec2(87f, 78f), new Vec2(52f, 25f), 76f, 88f, 2121f);
TestClonedEntityValues(e2, clonedE2, false, "after clone modif (e2)");
}