Example #1
0
            public void IsNotExecutedForComponentOfNoInterest()
            {
                var target = new FakeComponent1System();
                var world = new EntityWorld();
                world.AddSystem(target);
                var component = new FakeComponent2();
                Entity entity = world.CreateEntity();
                entity.AddComponent(component);

                world.Update(TimeSpan.Zero);

                Assert.False(component.Processed);
            }
Example #2
0
            public void IsExecutedForTwoComponentsOfInterest()
            {
                var target = new FakeComponent1And2System();
                var world = new EntityWorld();
                world.AddSystem(target);
                var component1 = new FakeComponent1();
                var component2 = new FakeComponent2();
                Entity entity = world.CreateEntity();
                entity.AddComponent(component1);
                entity.AddComponent(component2);

                world.Update(TimeSpan.Zero);

                Assert.True(component1.Processed);
                Assert.True(component2.Processed);
            }