Esempio n. 1
0
        public ForgeEngine(IList <Type> indexTypes, GameEnvironment gameEnvironment)
        {
            EntityManager  = new EntityManager(new EntityPool(ushort.MaxValue), indexTypes, ServiceContainer);
            GameLoop       = new GameLoop(EntityManager);
            SceneManager   = new SceneManager(EntityManager);
            ServiceManager = new ServiceManager(EntityManager, ServiceContainer);

            // Register services.
            ServiceContainer.AddService <GameEnvironment>(gameEnvironment);
            ServiceContainer.AddService <EntityManager>(EntityManager);
            ServiceContainer.AddService <ServiceManager>(ServiceManager);
            ServiceContainer.AddService <SceneManager>(SceneManager);
        }
Esempio n. 2
0
 /// <summary>
 /// Runs a single update tick.
 /// </summary>
 public void Tick(GameTime gameTime)
 {
     GameLoop.GameTime = gameTime;
     // Runs the step on each thread for the phase. Will not return until all have completed.
     GameLoop.Execute();
 }