Пример #1
0
 /**
  * TODO - Verify Completion
  *
  * <p>Checks to see if the given Player can place a road on the specified edge
  *
  * @pre None
  * @param UserId
  * @param edgeLocation
  * @return whether the Specified player can place a road on the specified edge
  */
 public boolean canDoPlaceRoadOnEdge(int UserId, EdgeLocation edgeLocation) {
   // Check if the user is the current player
   if (UserId != currentPlayer.getPlayerId()) {
     System.out.println("Game1: false");
     return false;
   }
   // If we are in the setup phase, the rules for placing a road are slightly different
   if (turnNumber == 0) {
     if (currentPlayer.getNumberUnplayedRoads() != 15) {
       return false;
     }
     return board.canDoPlaceInitialRoadOnEdge(getCurrentPlayer(), edgeLocation);
   } else if (turnNumber == 1) {
     if (currentPlayer.getNumberUnplayedRoads() != 14) {
       return false;
     }
     return board.canDoPlaceInitialRoadOnEdge(getCurrentPlayer(), edgeLocation);
   } else {
     return board.canDoPlaceRoadOnEdge(getCurrentPlayer(), edgeLocation);
   }
 }