Fixed: Building Card
This commit is contained in:
@@ -41,9 +41,34 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
|||||||
|
|
||||||
bought = false;
|
bought = false;
|
||||||
}
|
}
|
||||||
public BuildingCard(int effectId,EffectType effectType ,int era,int price,int prestigeValue) throws IllegalArgumentException{
|
public BuildingCard(int effectId ,int era,int price,int prestigeValue) throws IllegalArgumentException{
|
||||||
this.effectId = effectId;
|
this.effectId = effectId;
|
||||||
this.effectType = effectType;
|
switch (effectId){
|
||||||
|
case 2:
|
||||||
|
this.effectType=EffectType.ON_EVENT;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.effectType=EffectType.ON_END_TURN;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
this.effectType=EffectType.ON_EVENT;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
this.effectType=EffectType.ON_EVENT;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
this.effectType=EffectType.ON_EVENT;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
this.effectType=EffectType.ON_EVENT;
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
this.effectType=EffectType.ON_ROUND_END;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
|
||||||
|
}
|
||||||
this(era,price,prestigeValue);
|
this(era,price,prestigeValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +76,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
|||||||
@Override
|
@Override
|
||||||
public BuildingCard clone()
|
public BuildingCard clone()
|
||||||
{
|
{
|
||||||
return new BuildingCard(effectId,effectType,getEra(),getPrice(),getPrestigeValue());
|
return new BuildingCard(effectId,getEra(),getPrice(),getPrestigeValue());
|
||||||
}
|
}
|
||||||
public boolean buy(Player player) {
|
public boolean buy(Player player) {
|
||||||
if( bought || !player.removeFood(getPrice()))
|
if( bought || !player.removeFood(getPrice()))
|
||||||
|
|||||||
Reference in New Issue
Block a user