Exemple #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";
 }
Exemple #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"));
     }
   }
 }
Exemple #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());
   }
 }
Exemple #4
0
 public LaborCamp(int id, DiceCup diceCup) {
   super(id);
   this.diceCup = diceCup;
   price = Integer.parseInt(Texts.getText("f" + id + "s" + 3));
 }