Beispiel #1
0
        void ActivateScreen(ScreenEngine newScreenEngine, bool initialize = true)
        {
            newScreenEngine.Owner = this.ScreenEngine;

            lock (this.screenEngines) {
                screenEngines.Add(newScreenEngine);
                this.EnqueueEvent(new GameEvent(GameEventType.ScreenActivated, this.CurrentUpdateTime ?? new GameTime(), true));
            }

            if (initialize)
            {
                newScreenEngine.Initialize();
            }

            ResetControllers();
            GC.Collect();
        }