Examples of ESocialRank


Examples of ch.sahits.game.openpatrician.model.personal.ESocialRank

     
      // Name
      y = drawRow(g2d, y, firstColumn, "Name");
      StringBuilder sb = new StringBuilder();
      sb.append(data.getName()).append(" ").append(data.getLastName());
      ESocialRank rank = player.getRank();
      sb.append(" (").append(player.getCareerLevel()).append(" ").append(rank).append(")"); // TODO externalize
      y = drawRow(g2d, y, firstColumn, sb.toString());
     
      y += positions.lineHeight;
     
      // Birth
      DateObject now = new DateObject(Date.getInstance(0).getCurrentDate()); // TODO ugly
      y = drawRow(g2d, y, firstColumn, "Born");
      sb = new StringBuilder();
      ICity birthPlace = data.getBirthPlace();
      sb.append("on ").append(data.getBirthDate().toDisplayString()).append(" in ").append(birthPlace.getName()).append(", ");
      sb.append("Age ").append(data.getAge(now));
      y = drawRow(g2d, y, firstColumn, sb.toString());

      y += positions.lineHeight;

      y = drawRow(g2d, y, firstColumn, "Hometown");
      y = drawRow(g2d, y, firstColumn, player.getHometown().getName());
     
      y += positions.lineHeight;
      sb = new StringBuilder();
      sb.append("Social status in this town: ").append(city.getCity().getSocialRank());
      y = drawRow(g2d, y, firstColumn, sb.toString());
     
      IReputation rep = city.getCity().getReputation(player);
      int repDiff = rep.getReputationDifference();
      sb = new StringBuilder();
      if (repDiff<0){
        // reputation has sunk
        if (repDiff<=-10 && repDiff>-25){
          sb.append("Your reputation has sunken.");
        } else if (repDiff>-10){
          sb.append("Your reputation has sunken slightly");
        } else {
          sb.append("Your reputation has dropped");
        }
      } else if (repDiff>0){
        // reputation has risen
        if (repDiff>=10 && repDiff<25){
          sb.append("Your reputation has risen");
        } else if (repDiff<10){
          sb.append("Your reputation has risen slightly");
        } else {
          sb.append("Your reputation has risen massivly");
        }
      } else {
        sb.append("Your reputation in this city is unchanged");
      }
      y = drawRow(g2d, y, firstColumn, sb.toString());
     
      if (rank!=ESocialRank.ALDERMAN && rank!=ESocialRank.MAYOR){
        // draw string what is needed
        ESocialRank nextRank = rank.getNextRank();
        boolean needFortune = false;
        if (player.getCompany().getCompanyValue()<nextRank.getCompanyValue()){
          needFortune=true;
        }
        boolean needReputation=false;
        if (city.getCity().getReputation(player).getPopularity()<nextRank.getSocialReputation()){
          needReputation=true;
        }
        sb = new StringBuilder();
        if (needFortune && needReputation){
          sb.append("You need more fortune and respect in ").append(city.getCity().getName()).append(" to");
View Full Code Here

Examples of ch.sahits.game.openpatrician.model.personal.ESocialRank

  }

  @Override
  public void notify(DateObject date) {
    if (isNextRankAchievable()){
      ESocialRank nextRank = player.getRank().getNextRank();
      player.updateRank(nextRank);
    }

  }
View Full Code Here

Examples of ch.sahits.game.openpatrician.model.personal.ESocialRank

    }

  }
 
  public boolean isNextRankAchievable(){
    ESocialRank rank = player.getRank();
    ICity homeTown = player.getCompany().getHomeTown();
    if (rank==ESocialRank.PATRICIAN || rank==ESocialRank.MAYOR || rank==ESocialRank.ALDERMAN){
      return false;
    }
    long compValue = player.getCompany().getCompanyValue();
    ESocialRank nextRank = rank.getNextRank();
    IReputation rep = homeTown.getReputation(player);
    int popularity = rep.getPopularity();
    if (compValue>=nextRank.getCompanyValue() && popularity>=nextRank.getSocialReputation()){
      if (nextRank==ESocialRank.COUNCILMAN){
        // TODO check for guild membership
        return false;
      }
      return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.