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); }
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"); }