Added: BuildingCard check on price
This commit is contained in:
@@ -23,15 +23,23 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
||||
return effectType;
|
||||
}
|
||||
|
||||
public BuildingCard(int era,int price) {
|
||||
public BuildingCard(int era,int price) throws IllegalArgumentException{
|
||||
super(era);
|
||||
this.price = price;
|
||||
if (price > 0) {
|
||||
this.price = price;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
public BuildingCard(int effectId,EffectType effectType ,int era,int price) {
|
||||
public BuildingCard(int effectId,EffectType effectType ,int era,int price) throws IllegalArgumentException{
|
||||
this.effectId = effectId;
|
||||
this.effectType = effectType;
|
||||
super(era);
|
||||
this.price = price;
|
||||
if (price > 0) {
|
||||
this.price = price;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user