Ejemplo n.º 1
0
 /**
  * Get a template for the current most hated nation, depending whether the requestor has contacted
  * this settlement.
  *
  * @param contacted The contact status.
  * @return A <code>StringTemplate</code> describing the perceived most hated nation.
  */
 public StringTemplate getMostHatedLabel(boolean contacted) {
   return (contacted)
       ? ((mostHated == null)
           ? StringTemplate.key("model.indianSettlement.mostHatedNone")
           : mostHated.getNationName())
       : StringTemplate.key("model.indianSettlement.mostHatedUnknown");
 }
Ejemplo n.º 2
0
 /**
  * Get a label for one of the wanted goods.
  *
  * @param index The index into the wanted goods.
  * @param player The requesting <code>Player</code>.
  * @return A suitable <code>StringTemplate</code>.
  */
 public StringTemplate getWantedGoodsLabel(int index, Player player) {
   StringTemplate ret;
   if (hasVisited(player) && 0 <= index && index < wantedGoods.length) {
     if (wantedGoods[index] == null) {
       ret = StringTemplate.key("model.indianSettlement.wantedGoodsNone");
     } else {
       ret = StringTemplate.label("").add(Messages.nameKey(wantedGoods[index]));
       String sale = player.getLastSaleString(this, wantedGoods[index]);
       if (sale != null) ret.addName(" " + sale);
     }
   } else {
     ret = StringTemplate.key("model.indianSettlement.wantedGoodsUnknown");
   }
   return ret;
 }
Ejemplo n.º 3
0
 /**
  * Get a label appropriate to the current learnable skill and whether the requestor has visited
  * this settlement.
  *
  * @param visited The visiting status.
  * @return A <code>StringTemplate</code> describing the perceived skill.
  */
 public StringTemplate getLearnableSkillLabel(boolean visited) {
   return StringTemplate.key(
       (visited)
           ? ((learnableSkill == null)
               ? "model.indianSettlement.skillNone"
               : learnableSkill.getNameKey())
           : "model.indianSettlement.skillUnknown");
 }
Ejemplo n.º 4
0
 /** {@inheritDoc} */
 public StringTemplate getAlarmLevelLabel(Player player) {
   String key =
       (!player.hasContacted(owner))
           ? "model.indianSettlement.tension.wary"
           : (!hasContacted(player))
               ? "model.indianSettlement.tension.unknown"
               : "model.indianSettlement." + getAlarm(player).getKey();
   return StringTemplate.template(key).addStringTemplate("%nation%", getOwner().getNationName());
 }
Ejemplo n.º 5
0
 /** {@inheritDoc} */
 @Override
 public StringTemplate getLocationLabelFor(Player player) {
   return (hasContacted(player))
       ? StringTemplate.name(getName())
       : StringTemplate.key("model.indianSettlement.nameUnknown");
 }