예제 #1
0
        /// <summary>
        /// Constructs an engine loader with the given parameters using the default admin and default storages
        /// </summary>
        /// <param name="targetLogicFrameLength">the frame length in seconds of logic updates which the engine will attempt to keep</param>
        /// <param name="targetMaxRenderFrameLength">the frame length in seconds of render updates which the engine will try to stay below</param>
        /// <param name="componentTypePagePower">the size of component type pages as a power of 2</param>
        /// <param name="componentTypePageCount">the number of component type pages to start with, this can affect memory and performance</param>
        /// <param name="systemPagePower">the size of system pages as a power of 2</param>
        /// <param name="systemPageCount">the number of system pages to start with, this can affect memory and performance</param>
        /// <param name="entityPagePower">the size of entity pages as a power of 2</param>
        /// <param name="entityPageCount">the number of entity pages to start with, this can affect memory and performance</param>
        /// <param name="entityComponentPagePower">the size of entity-component link pages as a power of 2</param>
        /// <param name="entityComponentPageCount">the number of entity-component link pages to start with, this can affect memory and performance</param>
        protected EngineLoader(float targetLogicFrameLength = 1f / 60f, float targetMaxRenderFrameLength = 1f / 30f,
                               int componentTypePagePower   = 8, int componentTypePageCount = 1, int systemPagePower   = 8, int systemPageCount          = 1,
                               int entityPagePower          = 8, int entityPageCount = 1, int entityComponentPagePower = 8, int entityComponentPageCount = 1)
        {
            IComponentTypeRegistry registry = new ComponentTypeRegistry(componentTypePagePower, componentTypePageCount);

            Admin = new EntityAdmin(targetLogicFrameLength, targetMaxRenderFrameLength, registry,
                                    new SystemRegistry(systemPagePower, systemPageCount), new EntityBuffer(registry, 47, 47, entityPagePower, entityComponentPagePower, entityPagePower, systemPagePower,
                                                                                                           entityPageCount, entityComponentPageCount, entityPageCount, systemPageCount));
        }
예제 #2
0
        public static void Run()
        {
            IComponentTypeRegistry registry = new ComponentTypeRegistry();
            EntityAdmin            admin    = new EntityAdmin(1f / 60f, 1f / 30f, registry, new SystemRegistry(), new EntityBuffer(registry));

            admin.Run();
            Console.WriteLine("Done");
            Console.ReadLine();
            admin.Dispose();
        }