private int MyVictoryCheck(GameBoard board) { int column = -1; if (_difficulty == "hard") { column = board.VictoryCheckSpotCheck(this, true); } else { column = board.VictoryCheckSpotCheck(this, false); } return column; }
private int OpponentVictoryCheck(GameBoard board, Player player) { int column = -1; if (_difficulty == "hard") { column = board.VictoryCheckSpotCheck(player, true); } else { column = board.VictoryCheckSpotCheck(player, false); } return column; }
public int PickSpot(GameBoard board, Player player) { int moveColumnOpp, moveColumnMy; moveColumnOpp = OpponentVictoryCheck(board, player); moveColumnMy = MyVictoryCheck(board); if (moveColumnMy != -1) { return moveColumnMy; } else if (moveColumnOpp != -1) { return moveColumnOpp; } else { return MyMove(); } }