Beispiel #1
0
        void rMiddle_Click()
        {
            this.hideScene();
            Game.GraphicsDevice.Clear(Color.White);
            for (int i = 0; i < Game.Components.Count; i++)
            {
                if (Game.Components[i] is ActionScene)
                {
                    Game.Services.RemoveService(typeof(ActionScene));
                    Game.Components.RemoveAt(i);
                }
            }
            //The parameters should be read from Settings menu!
            ActionScene actionScene = new ActionScene(
                Game,
                typeof(BasicChessboardFactory),
                timersPanel.TimeScheme,
                player1Name,
                player2Name);

            Game.Components.Add(actionScene);
            Game.Services.AddService(typeof(ActionScene), actionScene);
            actionScene.showScene();
        }