Esempio n. 1
0
        public void GoToAIPanel()
        {
            state = ManagerState.Menu;
            ManagerInterface.SelectedIndex = 0;

            GameControl.Content = null;
            quatroInterface = null;
        }
Esempio n. 2
0
        public void StartGame()
        {
            state = ManagerState.Playing;
            ManagerInterface.SelectedIndex = 1;

            //fecth selection
            int AI1 = player1AIs.SelectedIndex;
            int AI2 = player2AIs.SelectedIndex;

            //In case of unselected AI's, go with first one
            if (AI1 == -1)
                AI1 = 0;
            if (AI2 == -1)
                AI2 = 0;

            QuatroPlayer player1 = allAIs[AI1].creator();
            QuatroPlayer player2 = allAIs[AI2].creator();

            QuatroOptions options = new QuatroOptions();
            switch(automaticComboBox.SelectedIndex)
            {
                case 0:
                    options.automaticPlay = QuatroOptions.AutomaticPlay.StepAnalysis;
                    break;
                case 1:
                    options.automaticPlay = QuatroOptions.AutomaticPlay.Regular;
                    break;
                case 2:
                    options.automaticPlay = QuatroOptions.AutomaticPlay.Automatic;
                    break;
            }
            options.turnSeconds = 10f;

            quatroInterface = new QuatroInterface(player1, player2, options);
            quatroInterface.Finished += GoToAIPanel;

            GameControl.Content = quatroInterface;
        }