コード例 #1
0
        private void BackHand_Click(object sender, EventArgs e)
        {
            if (Controls.OfType <Label>().All(label => label.Text == ""))
            {
                return;
            }
            if (_currentGame.GameFinished)
            {
                foreach (var label in Controls.OfType <Label>())
                {
                    label.Enabled   = true;
                    label.BackColor = SystemColors.Control;
                }
                _currentGame.GameFinished = false;
            }
            var backHandResult = _currentGame.BackHand();

            if (backHandResult != null)
            {
                foreach (var aiResult in backHandResult)
                {
                    AICallback(aiResult);
                }
            }
            if (_currentGame.NextHandContent == _aiContent)
            {
                _currentGame.AnalyzeBoard();
                AICallback(_currentGame.AICalc());
            }
        }
コード例 #2
0
 private void AIFirst_Click(object sender, EventArgs e)
 {
     ClearBoard();
     _aiContent   = "X";
     _currentGame = new GameCore(GameCore.GameMode.AI);
     _currentGame.AnalyzeBoard();
     AICallback(_currentGame.AICalc());
 }