diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building1.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building1.java index 8e4b82e..b6b2212 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building1.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building1.java @@ -12,18 +12,27 @@ public class Building1 extends BuildingCard { private CharacterType icon ; public CharacterType getIcon() {return icon;} + /** + * Constructor of the building + * @param era the game era of the building + * @param price the price (in food) of the building + * @param prestigeValue the number of Prestige Points gained from this building at the end of the game + * @param icon the character type used by the building effect + */ public Building1(int era, int price,int prestigeValue, CharacterType icon) { super(era,price,prestigeValue); effectType = EffectType.ON_EVENT; effectId = 1; this.icon = icon; } + + /** + * Method to clone the building: it creates an exact copy. + * @return the new copy of the building + */ @Override public BuildingCard clone() { return new Building1(getEra(),getPrice(),getPrestigeValue(),getIcon()); } - @Override - public void applyEffect(Player player) { - }; } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building10.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building10.java index 8411c31..7f9601c 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building10.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building10.java @@ -9,15 +9,29 @@ import it.polimi.ingsw.gc14.Model.Player; import java.util.HashMap; public class Building10 extends BuildingCard { + + /** + * Constructor of the building + * @param era the game era of the building + * @param price the price (in food) of the building + * @param prestigeValue the number of Prestige Points gained from this building at the end of the game + */ public Building10(int era, int price,int prestigeValue) { super(era,price,prestigeValue); effectType= EffectType.FINAL; effectId=10; } + + /** + * Method to clone the building: it creates an exact copy. + * @return the new copy of the building + */ @Override public BuildingCard clone() { return new Building10(getEra(),getPrice(),getPrestigeValue()); } + + @Override public void applyEffect(Player player) throws IllegalArgumentException { if(!player.buildingCards.contains(this)) diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building11.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building11.java index cc4de12..daa07df 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building11.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building11.java @@ -13,7 +13,14 @@ public class Building11 extends BuildingCard { private int PrestigeMul; public int getPrestigeMul() {return PrestigeMul;} - + /** + * Constructor of the building + * @param era the game era of the building + * @param price the price (in food) of the building + * @param prestigeValue the number of Prestige Points gained from this building at the end of the game + * @param icon the character type used by the building effect + * @param prestigeMul the Prestige Point multiplier used by the building effect + */ public Building11(int era, int price,int prestigeValue, CharacterType icon, int prestigeMul) { super(era,price,prestigeValue); effectType = EffectType.FINAL; @@ -21,10 +28,17 @@ public class Building11 extends BuildingCard { this.icon = icon; this.PrestigeMul = prestigeMul; } + + /** + * Method to clone the building: it creates an exact copy. + * @return the new copy of the building + */ @Override public BuildingCard clone() { return new Building11(getEra(),getPrice(),getPrestigeValue(), getIcon(), getPrestigeMul()); } + + @Override public void applyEffect(Player player) throws IllegalArgumentException { if(!player.buildingCards.contains(this)) diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building13.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building13.java index 852a21f..03a46e1 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building13.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building13.java @@ -5,15 +5,29 @@ import it.polimi.ingsw.gc14.Model.Cards.BuildingCard; import it.polimi.ingsw.gc14.Model.Player; public class Building13 extends BuildingCard{ + + /** + * Constructor of the building + * @param era the game era of the building + * @param price the price (in food) of the building + * @param prestigeValue the number of Prestige Points gained from this building at the end of the game + */ public Building13(int era, int price,int prestigeValue) { super(era,price,prestigeValue); effectType= EffectType.FINAL; effectId=13; } + + /** + * Method to clone the building: it creates an exact copy. + * @return the new copy of the building + */ @Override public BuildingCard clone() { return new Building13(getEra(),getPrice(),getPrestigeValue()); } + + @Override public void applyEffect(Player player) throws IllegalArgumentException { if(!player.buildingCards.contains(this)) diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building4.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building4.java index d7b2974..33fa499 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building4.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building4.java @@ -12,6 +12,13 @@ public class Building4 extends BuildingCard { boolean purchased ; int numPair; + + /** + * Constructor of the building + * @param era the game era of the building + * @param price the price (in food) of the building + * @param prestigeValue the number of Prestige Points gained from this building at the end of the game + */ public Building4(int era, int price,int prestigeValue) { super(era,price,prestigeValue); effectType= EffectType.INVENTOR_PAIR; @@ -42,6 +49,11 @@ public class Building4 extends BuildingCard { } + /** + * Method used to purchase the building. It also handles its initialization. + * @param player the player who buys the building + * @return the outcome of the operation + */ @Override public boolean buy(Player player) { @@ -51,10 +63,16 @@ public class Building4 extends BuildingCard { return true; } + /** + * Method to clone the building: it creates an exact copy. + * @return the new copy of the building + */ @Override public BuildingCard clone() { return new Building4(getEra(),getPrice(),getPrestigeValue()); } + + @Override public void applyEffect(Player player) throws IllegalArgumentException { if(!player.buildingCards.contains(this)) diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java index a2d2a6e..b7aac18 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Cards/Building/Effects/Building8.java @@ -10,15 +10,29 @@ import java.util.stream.Collectors; public class Building8 extends BuildingCard { + + /** + * Constructor of the building + * @param era the game era of the building + * @param price the price (in food) of the building + * @param prestigeValue the number of Prestige Points gained from this building at the end of the game + */ public Building8(int era, int price,int prestigeValue) { super(era,price,prestigeValue); effectType= EffectType.FINAL; effectId=8; } + + /** + * Method to clone the building: it creates an exact copy. + * @return the new copy of the building + */ @Override public BuildingCard clone() { return new Building8(getEra(),getPrice(),getPrestigeValue()); } + + @Override public void applyEffect(Player player) throws IllegalArgumentException { if(!player.buildingCards.contains(this))