Exemple #1
0
        public void EntityUniqueId()
        {
            HashSet <int> ids = new HashSet <int>();

            IGameSnapshot snapshot = LevelManager.CreateSnapshot();

            for (int i = 0; i < 200; ++i)
            {
                IEntity entity = snapshot.CreateEntity();
                Assert.True(ids.Add(entity.UniqueId));
            }
        }
Exemple #2
0
        public void RemodifyCurrentData()
        {
            IGameSnapshot snapshot = LevelManager.CreateSnapshot();
            IEntity       entity   = snapshot.CreateEntity();

            entity.AddData <DataConcurrentNonVersioned>();
            entity.AddData <DataConcurrentVersioned>();
            snapshot.Systems.Add(new DoubleModifySystem());

            ITemplateGroup templates = LevelManager.CreateTemplateGroup();

            IGameEngine engine = GameEngineFactory.CreateEngine(snapshot, templates).Value;

            for (int i = 0; i < 20; ++i)
            {
                engine.Update().Wait();
                engine.SynchronizeState().Wait();
            }
        }
Exemple #3
0
 public TestEntityBuilder NewEntity()
 {
     return(new TestEntityBuilder(Snapshot.CreateEntity()));
 }