示例#1
0
        public void OnBoardSpaceSelected(object sender, BoardSpaceSelectedEventArgs eventArgs)
        {
            BoardRow boardRow = (BoardRow)sender;
            int      row      = getRow(boardRow);

            ICoordinate coordinate = new Coordinate(row, eventArgs.Column);

            game.makeNextMove(coordinate);
        }
示例#2
0
 private int getRow(BoardRow row)
 {
     if (BoardRow0.Equals(row))
     {
         return(0);
     }
     if (BoardRow1.Equals(row))
     {
         return(1);
     }
     if (BoardRow2.Equals(row))
     {
         return(2);
     }
     throw new Exception("Invalid BoardSpace checked by getRow");
 }