Beispiel #1
0
  @Override
  public boolean invoke(String playerName) {

    // Union buildings exists as prerequirement.
    BuildingsHelper buildingHelper = new BuildingsHelper();
    Buildings building_record = buildingHelper.getBuildings(playerName);
    if (building_record == null) {
      // This should not happen.
      System.err.println("Player's " + playerName + " buildings record does not exists.");
    }
    int union_level = building_record.getStudentunion();
    if (union_level == Building.NOT_BUILT_LEVEL) {
      return false;
    }

    // Decreasing studented's satisfaction.
    return (decreaseSatisfaction(playerName, LotteryManager.LOW));
  }
  @Override
  public boolean invoke(String playerName) {

    // Prerequisite MacChicken built.
    BuildingsHelper helper = new BuildingsHelper();
    Buildings building_record = helper.getBuildings(playerName);
    if (building_record == null) {
      return false;
    }
    int chicken_level = building_record.getMacchicken();
    if (chicken_level == Building.NOT_BUILT_LEVEL) {
      return false;
    }

    // Increase students starvation.
    increaseStarvation(playerName, LotteryManager.MEDIUM);

    return true;
  }