Fix: Building Cards Bought Logic
This commit is contained in:
@@ -12,7 +12,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
||||
public int getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
private boolean bought;
|
||||
protected EffectType effectType;
|
||||
protected int effectId;
|
||||
|
||||
@@ -30,6 +30,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
bought = false;
|
||||
}
|
||||
public BuildingCard(int effectId,EffectType effectType ,int era,int price) throws IllegalArgumentException{
|
||||
this.effectId = effectId;
|
||||
@@ -49,7 +50,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
||||
return new BuildingCard(effectId,effectType,getEra(),getPrice());
|
||||
}
|
||||
public boolean buy(Player player) {
|
||||
if(!player.removeFood(getPrice()))
|
||||
if( bought || !player.removeFood(getPrice()))
|
||||
return false;
|
||||
player.buildingCards.add(this);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user