Building9, Building11 added and Sustenence fix
This commit is contained in:
@@ -14,9 +14,9 @@ public class Building1 extends BuildingCard {
|
|||||||
|
|
||||||
public Building1(int era, int price, CharacterType icon) {
|
public Building1(int era, int price, CharacterType icon) {
|
||||||
super(era,price);
|
super(era,price);
|
||||||
effectType= EffectType.ON_EVENT;
|
effectType = EffectType.ON_EVENT;
|
||||||
effectId=1;
|
effectId = 1;
|
||||||
this.icon=icon;
|
this.icon = icon;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public BuildingCard clone() {
|
public BuildingCard clone() {
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
||||||
|
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Player;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Building11 extends BuildingCard {
|
||||||
|
private CharacterType icon ;
|
||||||
|
public CharacterType getIcon() {return icon;}
|
||||||
|
private int PrestigeMul;
|
||||||
|
public int getPrestigeMul() {return PrestigeMul;}
|
||||||
|
|
||||||
|
|
||||||
|
public Building11(int era, int price, CharacterType icon, int prestigeMul) {
|
||||||
|
super(era,price);
|
||||||
|
effectType = EffectType.FINAL;
|
||||||
|
effectId = 11;
|
||||||
|
this.icon = icon;
|
||||||
|
this.PrestigeMul = prestigeMul;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public BuildingCard clone() {
|
||||||
|
return new Building11(getEra(),getPrice(), getIcon(), getPrestigeMul());
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void applyEffect(Player player) {
|
||||||
|
int Count = (int) player.getCharacterCards().stream()
|
||||||
|
.filter(x -> x.getType().equals(this.getIcon())).count();
|
||||||
|
player.addPrestige(Count * this.getPrestigeMul());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
||||||
|
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Player;
|
||||||
|
|
||||||
|
public class Building9 extends BuildingCard{
|
||||||
|
|
||||||
|
public Building9(int era, int price) {
|
||||||
|
super(era,price);
|
||||||
|
effectType = EffectType.ON_EVENT;
|
||||||
|
effectId=9;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public BuildingCard clone() {
|
||||||
|
return new Building9(getEra(),getPrice());
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void applyEffect(Player player) {
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -11,7 +11,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class Sustenance extends EventCard {
|
public class Sustenance extends EventCard {
|
||||||
int PrestigeDebt;
|
private int PrestigeDebt;
|
||||||
|
public int getPrestigeDebt() {
|
||||||
|
return PrestigeDebt;
|
||||||
|
}
|
||||||
|
|
||||||
public Sustenance(int Era, int PrestigeDebt) {
|
public Sustenance(int Era, int PrestigeDebt) {
|
||||||
super(Era, EventType.SUSTENANCE);
|
super(Era, EventType.SUSTENANCE);
|
||||||
|
|||||||
Reference in New Issue
Block a user