Beispiel #1
0
        public Entity CreateEntity()
        {
            switch (Type)
            {
            case EntityManagerType.ENTITY_MANAGER:
                return(EntityManager.CreateEntity());

            case EntityManagerType.ENTITY_COMMAND_BUFFER:
                return(EntityCommandBuffer.CreateEntity());

            case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT:
                return(EntityCommandBufferConcurrent.CreateEntity(EntityCommandBufferJobIndex));
            }

            throw new NotImplementedException();
        }
Beispiel #2
0
        public Entity CreateEntityFromArchetype <T>() where T : IArchetypeDescriptor
        {
            var archetype = EntityArchetypeManager.Instance.GetOrCreateArchetype <T>();

            switch (Type)
            {
            case EntityManagerType.ENTITY_MANAGER:
                return(EntityManager.CreateEntity(archetype));

            case EntityManagerType.ENTITY_COMMAND_BUFFER:
            case EntityManagerType.ENTITY_MANAGER_AND_COMMAND_BUFFER:
                return(EntityCommandBuffer.CreateEntity(archetype));

            case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT:
                return(EntityCommandBufferConcurrent.CreateEntity(EntityCommandBufferJobIndex, archetype));
            }

            throw new NotImplementedException();
        }
Beispiel #3
0
        public Entity CreateEntityFromArchetype(EntityArchetype archetype)
        {
            switch (Type)
            {
            case EntityManagerType.MOCK:
                return(Entity.Null);

            case EntityManagerType.ENTITY_MANAGER:
                return(EntityManager.CreateEntity(archetype));

            case EntityManagerType.ENTITY_COMMAND_BUFFER:
            case EntityManagerType.ENTITY_MANAGER_AND_COMMAND_BUFFER:
                return(EntityCommandBuffer.CreateEntity(archetype));

            case EntityManagerType.ENTITY_COMMAND_BUFFER_CONCURRENT:
                return(EntityCommandBufferConcurrent.CreateEntity(EntityCommandBufferJobIndex, archetype));
            }

            throw new NotImplementedException();
        }