コード例 #1
0
        // initializes the board and players.
        public void InitGame()
        {
            m_BlackPlayer     = new Player(Color.Black);
            m_WhitePlayer     = new Player(Color.White);
            m_CurrentPlayer   = m_BlackPlayer;
            m_BlackGamesScore = m_WhiteGamesScore = 0;

            FormGameSettings formSettings = new FormGameSettings();

            formSettings.ShowDialog();
            if (formSettings.DialogResult == DialogResult.OK)
            {
                if (formSettings.IsAgainstComputer)
                {
                    m_WhitePlayer.IsComputer = true;
                }

                m_CurrentGame = new GameEngine(formSettings.BoardSize);
                m_GameUI      = new GameForm(formSettings.BoardSize, this);
                m_CurrentGame.InitNewGame();

                startGame();
            }
        }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: liornaar/mta-othello
        // initializes the board and players.
        public void InitGame()
        {
            m_BlackPlayer = new Player(Color.Black);
            m_WhitePlayer = new Player(Color.White);
            m_CurrentPlayer = m_BlackPlayer;
            m_BlackGamesScore = m_WhiteGamesScore = 0;

            FormGameSettings formSettings = new FormGameSettings();
            formSettings.ShowDialog();
            if (formSettings.DialogResult == DialogResult.OK)
            {
                if (formSettings.IsAgainstComputer)
                {
                    m_WhitePlayer.IsComputer = true;
                }

                m_CurrentGame = new GameEngine(formSettings.BoardSize);
                m_GameUI = new GameForm(formSettings.BoardSize, this);
                m_CurrentGame.InitNewGame();

                startGame();
            }
        }