Esempio n. 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();
                }
            }
        }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     theGM       = FindObjectOfType <GameModel>();
     buttonState = (GameModel.State)(instructionID);
 }
Esempio n. 3
0
 public void MakeMove(int i, int j, GameModel.State side)
 {
     model.MakeMove(i, j, side);
 }