Esempio n. 1
0
 public override bool Equals(object obj)
 {
     if (obj is Forza4GameMove)
     {
         Forza4GameMove gMove = obj as Forza4GameMove;
         return(gMove.move == move);
     }
     return(false);
 }
        public void DoMove(IGameMove move)
        {
            Forza4GameMove f4Move = new Forza4GameMove(move.move);

//            _stateChanged = true;
            for (int i = _rows - 1; i >= 0; i--)
            {
                if (board[i, f4Move.move] == 0)
                {
                    board[i, f4Move.move] = this.currentPlayer;
                    if (CheckWinDirections(this.currentPlayer, i, f4Move.move))
                    {
                        _winner = this.currentPlayer;
                    }
                    this.playerJustMoved = this.currentPlayer;
                    this.currentPlayer   = 3 - this.currentPlayer;
                    break;
                }
            }
        }