mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 00:06:16 +01:00
fixed GateField rent
This commit is contained in:
parent
aa86c25e7c
commit
14ceb9dc67
@ -372,7 +372,7 @@ public class Player implements FieldVisitor<Void>{
|
|||||||
public Void visit(GateField field) {
|
public Void visit(GateField 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 {
|
} else if (field.getOwner() != this){
|
||||||
int rent = field.calcRent() * field.getOwner().getNumProp(field);
|
int rent = field.calcRent() * field.getOwner().getNumProp(field);
|
||||||
|
|
||||||
field.getOwner().earnMoney(rent);
|
field.getOwner().earnMoney(rent);
|
||||||
@ -487,8 +487,8 @@ public class Player implements FieldVisitor<Void>{
|
|||||||
}
|
}
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private static int c = 0;
|
// private static int c = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inner class for dice functionality in the game.
|
* Inner class for dice functionality in the game.
|
||||||
* Rolls random dice values.
|
* Rolls random dice values.
|
||||||
@ -503,8 +503,8 @@ public class Player implements FieldVisitor<Void>{
|
|||||||
*/
|
*/
|
||||||
private static int rollDice() {
|
private static int rollDice() {
|
||||||
return random.nextInt(6) + 1;
|
return random.nextInt(6) + 1;
|
||||||
|
|
||||||
// c++;
|
// c++;
|
||||||
|
// return (c%2 == 0)? 3: 2;
|
||||||
// if(c < 7) {
|
// if(c < 7) {
|
||||||
// return 3;
|
// return 3;
|
||||||
// } else {
|
// } else {
|
||||||
|
@ -11,7 +11,7 @@ public class GateField extends PropertyField{
|
|||||||
}
|
}
|
||||||
|
|
||||||
GateField(String name, int id) {
|
GateField(String name, int id) {
|
||||||
super(name, id, 2000, 25);
|
super(name, id, 2000, 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user