Example #1
0
  /**
   * The process of a turn for one player. Will move their token(unless in jail). Pay any rent/ get
   * any cards automatically and then gives them options to buy/sell mortgage/unmortgage and check
   * on their statistics in the game.
   *
   * @param currentPlayer
   */
  public void turn(Player player) {
    menus.clear();
    menus.add(new DefaultMenu(player, this));
    actionInfo = "";
    currentPlayer = player;

    String playerName = currentPlayer.name();

    if (!currentPlayer.inJail()) {
      int roll = dice.rollDice();

      movePlayer(roll, currentPlayer);
      currentTile = Locations[playerPositions.get(currentPlayer)];
      currentPlayer.setCurrentPosition(currentTile);

      // 			prints relevant
      //			 information if it
      //			 is a property(e.g
      //			 owner, cost)

      actionInfo = currentTile.autoAction(currentPlayer);
    } else {

      currentTile = Locations[playerPositions.get(currentPlayer)];
      currentTile.autoAction(currentPlayer);
      return;
    }
  }
Example #2
0
 public String getInfo() {
   return currentTile.toString();
 }