Exemplo n.º 1
0
        public void HasComponent()
        {
            var entity    = EntityManager.CreateEntity();
            var component = new DummyComponent1();

            entity.Add(component);
            Assert.That(entity.Has(component));
            Assert.That(entity.Has(component.GetType()));
            Assert.That(entity.Has <DummyComponent1>());
        }
Exemplo n.º 2
0
        public void ComponentDuplicatesNotAllowed()
        {
            var entity    = EntityManager.CreateEntity();
            var component = new DummyComponent1();

            entity.Add(component);
            entity.Add(component);
            entity.Add(component);

            Assert.That(entity.Count, Is.EqualTo(1));
            Assert.That(entity.GetAll(component.GetType()).Count, Is.EqualTo(1));
        }