mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 04:56:15 +01:00
trigger NoMoneyPopUp
This commit is contained in:
parent
0c90d1f185
commit
29e9b54cc4
@ -294,6 +294,8 @@ public class TestWorld implements GameEventListener {
|
|||||||
new ConfirmTrade(app).open();
|
new ConfirmTrade(app).open();
|
||||||
} else if (event.msg().equals("goingToJail")) {
|
} else if (event.msg().equals("goingToJail")) {
|
||||||
new Gulag(app).open();
|
new Gulag(app).open();
|
||||||
|
} else if (event.msg().equals("NoMoneyWarning")) {
|
||||||
|
new NoMoneyWarning(app).open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,6 +345,8 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
|
|||||||
notifyListeners(new PopUpEvent("rent", msg));
|
notifyListeners(new PopUpEvent("rent", msg));
|
||||||
} else if (msg.getKeyWord().equals("jailpay")) {
|
} else if (msg.getKeyWord().equals("jailpay")) {
|
||||||
notifyListeners(new PopUpEvent(msg.getKeyWord(), msg));
|
notifyListeners(new PopUpEvent(msg.getKeyWord(), msg));
|
||||||
|
} else if(msg.getKeyWord().equals("NoMoneyWarning")) {
|
||||||
|
notifyListeners(new PopUpEvent("NoMoneyWarning", msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,6 +332,7 @@ public class Player implements FieldVisitor<Void>{
|
|||||||
public Void visit(BuildingProperty field) {
|
public Void visit(BuildingProperty field) {
|
||||||
if(field.getOwner() == null) {
|
if(field.getOwner() == null) {
|
||||||
if (field.getPrice() <= accountBalance) getHandler().getLogic().send(this, new BuyPropertyRequest());
|
if (field.getPrice() <= accountBalance) getHandler().getLogic().send(this, new BuyPropertyRequest());
|
||||||
|
else getHandler().getLogic().send(this, new NotificationMessage("NoMoneyWarning"));
|
||||||
} else if (field.getOwner() != this){
|
} else if (field.getOwner() != this){
|
||||||
int rent = field.calcRent();
|
int rent = field.calcRent();
|
||||||
field.getOwner().earnMoney(rent);
|
field.getOwner().earnMoney(rent);
|
||||||
|
Loading…
Reference in New Issue
Block a user