public static void switchPlayers() { moveCounter++; if (currentPlayer.Equals(playerOne)) { currentPlayer = playerTwo; playerTwo.getNewMoves(drawCube.cube); playerOne.getNewMoves(drawCube.cube); if (playerTwo.possibleMoves.Count == 0) { endGame(playerOne.playerNumber); } else if (playerOne.possibleMoves.Count == 0) { endGame(playerTwo.playerNumber); } } else if (currentPlayer.Equals(playerTwo)) { currentPlayer = playerOne; playerOne.getNewMoves(drawCube.cube); playerTwo.getNewMoves(drawCube.cube); if (playerOne.possibleMoves.Count == 0) { endGame(playerTwo.playerNumber); } else if (playerTwo.possibleMoves.Count == 0) { endGame(playerOne.playerNumber); } } }
public static void restartGame() { drawCube = new Cube(); playerOne.currentPosition = null; playerTwo.currentPosition = null; switch (Config.convertSettingToInt("game", "starting_player")) { case 1: currentPlayer = playerOne; break; case 2: currentPlayer = playerTwo; break; } currentPlayer.getNewMoves(drawCube.cube); }
public static void restartGame() { drawCube = new Cube(); playerOne.currentPosition = null; playerTwo.currentPosition = null; switch (Config.convertSettingToInt("game", "starting_player")) { case 1: currentPlayer = playerOne; break; case 2: currentPlayer = playerTwo; break; } currentPlayer.getNewMoves(drawCube.cube); }