diff --git a/src/GomokuGame.java b/src/GomokuGame.java index 4b65a93..8b8498d 100644 --- a/src/GomokuGame.java +++ b/src/GomokuGame.java @@ -63,22 +63,11 @@ public class GomokuGame { /** * Place the token on the cell where the player play. - * @param turn the turn of the player. + * @param Player get player to play the cell. */ - public void play(int turn) { + public void play(Player player) { - GomokuCell cellToPlay = null; - switch (turn) { - case 1: - cellToPlay = player1.chooseMove(board); - break; - case 2: - cellToPlay = player2.chooseMove(board); - break; - default: - throw new IllegalArgumentException("Invalid turn: " + turn); - } - + GomokuCell cellToPlay = player.chooseMove(board); cellToPlay.setState(colorP1); }