コード例 #1
0
        public void MakeMove(int i, int j, GameModel.State side)
        {
            model.MakeMove(i, j, side);

            if (model.GameOver)
            {
                MessageBox.Show("Game Over, winner is " + symbols[model.Winner] + "\n" +
                                "Count of X's winners: " + GameModel.countXWin + "\n" +
                                "Count of O's winners: " + GameModel.countOWin + "\n" +
                                "Count of draws: " + GameModel.draw);

                DialogResult result = MessageBox.Show("Would you like to play again?", "Message", MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                if (result == DialogResult.Yes)
                {
                    model             = new GameModel();
                    model.UpdateView += UpdateView;
                    UpdateView(model);
                }

                else
                {
                    this.Close();
                }
            }
        }
コード例 #2
0
ファイル: Action.cs プロジェクト: VPoint/HighNoon
 // Use this for initialization
 void Start()
 {
     theGM       = FindObjectOfType <GameModel>();
     buttonState = (GameModel.State)(instructionID);
 }
コード例 #3
0
 public void MakeMove(int i, int j, GameModel.State side)
 {
     model.MakeMove(i, j, side);
 }