示例#1
0
 @Override
 public String toString() {
   return "Name: "
       + Texts.getText("f" + id + "s1")
       + "\tType: Labor Camp\tPrice: "
       + Texts.getText("f" + id + "s3")
       + "\tRent: 100 x dice\n";
 }
示例#2
0
 @Override
 public void buyField(Player player) {
   int svar = GUI.getUserInteger(Texts.getText("køb"));
   while (svar != 1 && svar != 2) {
     // Man har svaret andet end 1 eller 2
     svar = GUI.getUserInteger(Texts.getText("køb"));
   }
   if (svar == 1) {
     if (player.getBalance() > price) {
       player.addToBalance(-price);
       super.setOwner(player);
       GUI.setOwner(player.getCurrentField() + 1, player.getName());
       GUI.showMessage(
           Texts.getText("købt") + Texts.getText("f" + player.getCurrentField() + "s" + 1));
       player.setLaborCamp();
     } else {
       GUI.showMessage(Texts.getText("fattig"));
     }
   }
 }
示例#3
0
 @Override
 public void payRent(Player player) {
   if (player.getBalance() > getRent()) {
     player.addToBalance(-getRent());
     owner.addToBalance(getRent());
     GUI.showMessage(Texts.getText("husleje") + owner.getName());
     GUI.setBalance(player.getName(), player.getBalance());
     GUI.setBalance(owner.getName(), owner.getBalance());
   } else {
     owner.addToBalance(player.getBalance());
     player.bankrupt();
     GUI.removeAllCars(player.getName());
   }
 }
示例#4
0
 public LaborCamp(int id, DiceCup diceCup) {
   super(id);
   this.diceCup = diceCup;
   price = Integer.parseInt(Texts.getText("f" + id + "s" + 3));
 }