public void Entity_Add_Remove()
        {
            TestSetUp();

            EntityFramework.ComponentInterfaces.ITagSystem tagSys =
                new EntityFramework.Components.TagSystem();
            tagSys.Init(typeof(EntityFramework.Components.Tag));
            _system.AddComponentSystem <EntityFramework.ComponentInterfaces.ITagSystem>
                (tagSys);

            Guid id = Guid.NewGuid();

            _system.AddNewEntity(id);

            _system.AddComponentToEntity
            <EntityFramework.ComponentInterfaces.ITagSystem>(id);

            _system.RemoveComponentFromEntity
            <EntityFramework.ComponentInterfaces.ITagSystem>(id);

            _system.RemoveComponentSystem
            <EntityFramework.ComponentInterfaces.ITagSystem>();

            _system.RemoveEntity(id);

            TestTearDown();
        }
 public void ComponentSystem_Init_Tag_With_Tag()
 {
     EntityFramework.ComponentInterfaces.ITagSystem tagSys =
         new EntityFramework.Components.TagSystem();
     tagSys.Init(typeof(EntityFramework.Components.Tag));
     Assert.That(tagSys.GetGenerateType() != null);
 }
 public void ComponentSystem_Init_Tag_With_Tag()
 {
     EntityFramework.ComponentInterfaces.ITagSystem tagSys =
         new EntityFramework.Components.TagSystem();
     tagSys.Init(typeof(EntityFramework.Components.Tag));
     Assert.That(tagSys.GetGenerateType() != null);
 }
 public void ComponentSystem_Init_Tag_With_BaseComponent()
 {
     EntityFramework.ComponentInterfaces.ITagSystem tagSys =
         new EntityFramework.Components.TagSystem();
     // The following should throw an error
     tagSys.Init(typeof(EntityFramework.Component));
     // This should not hit
     Assert.That(tagSys.GetGenerateType() == null);
 }
 public void ComponentSystem_Init_Tag_With_NonTag()
 {
     EntityFramework.ComponentInterfaces.ITagSystem tagSys =
         new EntityFramework.Components.TagSystem();
     // The following should throw an error
     tagSys.Init(typeof(EntityFramework.Components.Children));
     // This should not hit
     Assert.That(tagSys.GetGenerateType() == null);
 }
        public void MultipleComponents_DifferentTypes()
        {
            TestSetUp();

            EntityFramework.ComponentInterfaces.ITagSystem tagSys =
                new EntityFramework.Components.TagSystem();
            tagSys.Init(typeof(EntityFramework.Components.Tag));

            EntityFramework.ComponentInterfaces.IChildrenSystem childSys =
                new EntityFramework.Components.ChildrenSystem();
            childSys.Init(typeof(EntityFramework.Components.Children));

            _system.AddComponentSystem <EntityFramework.ComponentInterfaces.ITagSystem>
                (tagSys);
            _system.AddComponentSystem <EntityFramework.ComponentInterfaces.IChildrenSystem>
                (childSys);

            Guid id = Guid.NewGuid();

            _system.AddNewEntity(id);

            _system.AddComponentToEntity
            <EntityFramework.ComponentInterfaces.ITagSystem>(id);
            _system.AddComponentToEntity
            <EntityFramework.ComponentInterfaces.IChildrenSystem>(id);

            _system.RemoveComponentFromEntity
            <EntityFramework.ComponentInterfaces.ITagSystem>(id);
            _system.RemoveComponentFromEntity
            <EntityFramework.ComponentInterfaces.IChildrenSystem>(id);

            _system.RemoveComponentSystem
            <EntityFramework.ComponentInterfaces.ITagSystem>();
            _system.RemoveComponentSystem
            <EntityFramework.ComponentInterfaces.IChildrenSystem>();

            _system.RemoveEntity(id);

            TestTearDown();
        }
        public void MultipleComponents_DifferentTypes()
        {
            TestSetUp();

            EntityFramework.ComponentInterfaces.ITagSystem tagSys =
                new EntityFramework.Components.TagSystem();
            tagSys.Init(typeof(EntityFramework.Components.Tag));

            EntityFramework.ComponentInterfaces.IChildrenSystem childSys =
                new EntityFramework.Components.ChildrenSystem();
            childSys.Init(typeof(EntityFramework.Components.Children));

            _system.AddComponentSystem<EntityFramework.ComponentInterfaces.ITagSystem>
                (tagSys);
            _system.AddComponentSystem<EntityFramework.ComponentInterfaces.IChildrenSystem>
                (childSys);

            Guid id = Guid.NewGuid();
            _system.AddNewEntity(id);

            _system.AddComponentToEntity
                <EntityFramework.ComponentInterfaces.ITagSystem>(id);
            _system.AddComponentToEntity
                <EntityFramework.ComponentInterfaces.IChildrenSystem>(id);

            _system.RemoveComponentFromEntity
                <EntityFramework.ComponentInterfaces.ITagSystem>(id);
            _system.RemoveComponentFromEntity
                <EntityFramework.ComponentInterfaces.IChildrenSystem>(id);

            _system.RemoveComponentSystem
                <EntityFramework.ComponentInterfaces.ITagSystem>();
            _system.RemoveComponentSystem
                <EntityFramework.ComponentInterfaces.IChildrenSystem>();

            _system.RemoveEntity(id);

            TestTearDown();
        }
        public void MultipleComponentSameType()
        {
            TestSetUp();

            EntityFramework.ComponentInterfaces.ITagSystem tagSys =
                new EntityFramework.Components.TagSystem();
            tagSys.Init(typeof(EntityFramework.Components.Tag));

            _system.AddComponentSystem<EntityFramework.ComponentInterfaces.ITagSystem>
                (tagSys);

            Guid id = Guid.NewGuid();
            _system.AddNewEntity(id);

            _system.AddComponentToEntity
                <EntityFramework.ComponentInterfaces.ITagSystem>(id);

            _system.AddComponentToEntity
                <EntityFramework.ComponentInterfaces.ITagSystem>(id);

            _system.RemoveComponentSystem
                <EntityFramework.ComponentInterfaces.ITagSystem>();

            TestTearDown();
        }