Examples of IPlayer


Examples of ch.bfh.jass.interfaces.IPlayer

     */
    private void nextPlayer() throws GameOverException {
        if (this.table.getSize() < this.rule.getNumberOfTableCards()) {
            this.players.next();
        } else {
            IPlayer turnWinner = this.getTurnWinner();
            this.players.setCurrent(turnWinner);
            this.clearTable();
            if (!this.players.getCurrent().hasCards()) {
                this.players.setCurrent(this.rule.getStarter());
                this.rule.setStarter(this.players.next());
View Full Code Here

Examples of ch.sahits.game.openpatrician.model.IPlayer

     
      leftBorderX = getInset().left; // Use local coordinates
      firstColumn = leftBorderX+20; // right aligned
     
      // table header
      IPlayer player = city.getPlayer();
      IPersonalData data = player.getPersonalData();
      y += positions.lineHeight; // more space to the title
     
      // 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");
          y = drawRow(g2d, y, firstColumn, sb.toString());
          sb = new StringBuilder();
          sb.append("advanve to the next social rank");
          y = drawRow(g2d, y, firstColumn, sb.toString());
        } else if (needFortune){
          sb.append("You need more fortune in ").append(city.getCity().getName()).append(" to");
          y = drawRow(g2d, y, firstColumn, sb.toString());
          sb = new StringBuilder();
          sb.append("advanve to the next social rank");
          y = drawRow(g2d, y, firstColumn, sb.toString());
        } else if (needReputation){
          sb.append("You need more respect in ").append(city.getCity().getName()).append(" to");
          y = drawRow(g2d, y, firstColumn, sb.toString());
          sb = new StringBuilder();
          sb.append("advanve to the next social rank");
          y = drawRow(g2d, y, firstColumn, sb.toString());
        } else {
          y += positions.lineHeight;
          y += positions.lineHeight;
        }
      } else {
        y += positions.lineHeight;
        y += positions.lineHeight;
      }
     
      // Draw underworld string
      ICareer careerLevel = player.getCareerLevel();
      String s;
      if (careerLevel instanceof IMilitantCareer){
        if (((EMilitantCareer)careerLevel)!=EMilitantCareer.BOISTEROUS &&
          ((EMilitantCareer)careerLevel)!=EMilitantCareer.BOLD ){
          s = "The underworld fears you";
        } else {
          s = "The underworld avoids you";
        }
      } else {
        s = "The underworld avoids you";
      }
      y = drawRow(g2d, y, firstColumn, s);
      y += positions.lineHeight;
     
      if (player.getSpouseData()!=null){
        ISpouseData spouse = player.getSpouseData();
        // Name
        if (spouse.isMale()){
          s = "Name of husband"; // TODO externalize
        } else {
          s = "Name of wife";
        }
        y = drawRow(g2d, y, firstColumn, s);
        sb = new StringBuilder();
        sb.append(spouse.getName()).append(" ").append(spouse.getLastName());
        sb.append(", Age ").append(spouse.getAge(now));
        y = drawRow(g2d, y, firstColumn, sb.toString());
       
        y += positions.lineHeight;
       
        // Birth
        y = drawRow(g2d, y, firstColumn, "Born");
        sb = new StringBuilder();
        sb.append("on ").append(data.getBirthDate().toDisplayString()).append(" in ").append(birthPlace.getName());
        y = drawRow(g2d, y, firstColumn, sb.toString());

        y += positions.lineHeight;

        y = drawRow(g2d, y, firstColumn, "Children");
        y = drawRow(g2d, y, firstColumn, String.valueOf(spouse.getNumberOfChildren()));
       
        y += positions.lineHeight;

        sb = new StringBuilder();
        if (city.getCity()==birthPlace){
          // TODO consider the spouses popularity and relations
          if (spouse.isMale()){
            sb.append("Your husband is unknown to the citizens of ").append(city.getCity().getName());
          } else {
            sb.append("Your wife is unknown to the citizens of ").append(city.getCity().getName());
          }
          y = drawRow(g2d, y, firstColumn, sb.toString());
          sb = new StringBuilder();
          y = drawRow(g2d, y, firstColumn, sb.toString());
          sb.append("and has no relations with the counsilmen.");
        } else if (city.getCity()==player.getCompany().getHomeTown()){
          // TODO consider the spouses popularity and relations
          if (spouse.isMale()){
            sb.append("Your husband is unknown to the citizens of ").append(city.getCity().getName());
          } else {
            sb.append("Your wife is unknown to the citizens of ").append(city.getCity().getName());
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        chartBox.disconnectWidgetFromAll(chartViewer);
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        if (playerMode) {
            initPlayerAttributes(false);
        }
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        }
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        updatePlayer();
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        }
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        updatePlayer();
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        }
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        updatePlayer();
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        chartBox.disconnectWidgetFromAll(chartViewer);
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        if (playerMode) {
            initPlayerAttributes(false);
        }
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        chartBox.disconnectWidgetFromAll(chartViewer);
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        if (playerMode) {
            initPlayerAttributes(false);
        }
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        }
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        updatePlayer();
    }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.IPlayer

        chartBox.disconnectWidgetFromAll(chartViewer);
    }

    @Override
    public void indexChanged(PlayerEvent event) {
        IPlayer player = (IPlayer) event.getSource();
        playerIndex = player.getIndex();
        if (playerMode) {
            initPlayerAttributes(false);
        }
    }
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.