Exemple #1
0
        /// <summary>
        /// Removes global components
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PeaScreen_Exited(object sender, EventArgs e)
        {
            this.Game.Components.Remove(_scene);
            this.Game.Components.Remove(_dataGrid);
            this.Game.Components.Remove(_pointsController);
            this.Game.Components.Remove(_peaController);
            this.Game.Components.Remove(_inputController);
            this.Game.Components.Remove(_achievementController);
            this.Game.Components.Remove(_timeController);

            this.Game.Services.RemoveService(typeof(TimeController));

            var peas = _peaController.DeRegisterAll();

            foreach (var pea in peas)
            {
                this.Game.Components.Remove(pea);
            }
        }
        /// <summary>
        /// Removes global components
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PeaScreen_Exited(object sender, EventArgs e)
        {
            this.Game.Components.Remove(_scene);
            this.Game.Components.Remove(_dataGrid);
            this.Game.Components.Remove(_pointsController);
            this.Game.Components.Remove(_peaController);
            this.Game.Components.Remove(_inputController);
            this.Game.Components.Remove(_achievementController);
            this.Game.Components.Remove(_timeController);

            this.Game.Services.RemoveService(typeof(TimeController));

            var peas = _peaController.DeRegisterAll();

            foreach (var pea in peas)
            {
                this.Game.Components.Remove(pea);
            }

            if (this.IsEnabled)
            {
                this.ScreenManager.AddScreen(new ScoreScreen(_width, _height, _pointsController.PlayingTime));
            }
        }