Fixed: JavaDOC of buildings 10, 11, 13 to avoid merge conflicts
This commit is contained in:
@@ -2,23 +2,19 @@ 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.Character;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* At the end of the game, you gain 6 Prestige Points for each set of 6 different character cards in your tribe.
|
||||
*/
|
||||
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
|
||||
* Creates a Building10 card with the specified era, price, and prestige value.
|
||||
*
|
||||
* @param era the era of the building card.
|
||||
* @param price the price of the building card.
|
||||
* @param prestigeValue the prestige value of the building card.
|
||||
*/
|
||||
public Building10(int era, int price,int prestigeValue) {
|
||||
super(era,price,prestigeValue);
|
||||
@@ -27,8 +23,9 @@ public class Building10 extends BuildingCard {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to clone the building: it creates an exact copy.
|
||||
* @return the new copy of the building
|
||||
* Creates and returns a copy of this Building10 card.
|
||||
*
|
||||
* @return a clone of this Building10 card.
|
||||
*/
|
||||
@Override
|
||||
public BuildingCard clone() {
|
||||
@@ -36,15 +33,19 @@ public class Building10 extends BuildingCard {
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of different character sets, and the player gains Prestige Points
|
||||
* equal to the number of sets multiplied by 6.
|
||||
* @param player the player who owns the building
|
||||
* @throws IllegalArgumentException thrown if the specified player does not own this building.
|
||||
* Applies the effect of this building card to the specified player.
|
||||
* The effect grants 6 prestige points for each complete set of character cards.
|
||||
* owned by the player, where a complete set contains one card of each.
|
||||
* {@link CharacterType}.
|
||||
*
|
||||
* @param player the player to whom the effect is applied.
|
||||
* @throws IllegalArgumentException if the player does not own this building card.
|
||||
*/
|
||||
@Override
|
||||
public void applyEffect(Player player) throws IllegalArgumentException {
|
||||
if(!player.buildingCards.contains(this))
|
||||
throw new IllegalArgumentException();
|
||||
HashMap<CharacterType,Integer> map = new HashMap<CharacterType,Integer>();
|
||||
|
||||
int numSet=player.getNType(CharacterType.INVENTOR);
|
||||
for(CharacterType type : CharacterType.values())
|
||||
@@ -56,4 +57,4 @@ public class Building10 extends BuildingCard {
|
||||
player.addPrestige(6 * numSet);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,41 +5,33 @@ 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;
|
||||
|
||||
/**
|
||||
* At the end of the game, you gain the indicated amount of Prestige Points for each character
|
||||
* card of the indicated type in your tribe.
|
||||
*/
|
||||
public class Building11 extends BuildingCard {
|
||||
|
||||
/**
|
||||
* Character type used by the building effect
|
||||
*/
|
||||
private CharacterType icon ;
|
||||
|
||||
/**
|
||||
* @return the icon attribute
|
||||
* Returns the CharacterType associated with this building card effect.
|
||||
*
|
||||
* @return the CharacterType associated with this building card effect.
|
||||
*/
|
||||
public CharacterType getIcon() {return icon;}
|
||||
|
||||
/**
|
||||
* Prestige multiplier used by the building effect
|
||||
*/
|
||||
private int PrestigeMul;
|
||||
|
||||
/**
|
||||
* @return the prestige multiplier attribute
|
||||
* Returns the prestige multiplier associated with this building card effect.
|
||||
*
|
||||
* @return the prestige multiplier associated with this building card effect.
|
||||
*/
|
||||
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
|
||||
* Creates a Building11 card with the specified era, price, prestige value,
|
||||
* character type icon, and prestige multiplier.
|
||||
*
|
||||
* @param era the era of the building card.
|
||||
* @param price the price of the building card.
|
||||
* @param prestigeValue the prestige value of the building card.
|
||||
* @param icon the CharacterType associated with the building card effect.
|
||||
* @param prestigeMul the prestige multiplier of the building card effect.
|
||||
*/
|
||||
public Building11(int era, int price,int prestigeValue, CharacterType icon, int prestigeMul) {
|
||||
super(era,price,prestigeValue);
|
||||
@@ -50,8 +42,9 @@ public class Building11 extends BuildingCard {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to clone the building: it creates an exact copy.
|
||||
* @return the new copy of the building
|
||||
* Creates and returns a copy of this Building11 card.
|
||||
*
|
||||
* @return a clone of this Building11 card.
|
||||
*/
|
||||
@Override
|
||||
public BuildingCard clone() {
|
||||
@@ -59,10 +52,12 @@ public class Building11 extends BuildingCard {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the number of characters of the indicated type.
|
||||
* Adds an amount of Prestige Points equal to the number of characters multiplied by the prestige multiplier.
|
||||
* @param player the player who owns the building
|
||||
* @throws IllegalArgumentException thrown if the specified player does not own this card.
|
||||
* Applies the effect of this building card to the specified player.
|
||||
* The effect grants prestige points equal to the number of cards of the
|
||||
* associated CharacterType owned by the player, multiplied by the prestige multiplier.
|
||||
*
|
||||
* @param player the player to whom the effect is applied-
|
||||
* @throws IllegalArgumentException if the player does not own this building card-
|
||||
*/
|
||||
@Override
|
||||
public void applyEffect(Player player) throws IllegalArgumentException {
|
||||
@@ -70,4 +65,4 @@ public class Building11 extends BuildingCard {
|
||||
throw new IllegalArgumentException();
|
||||
player.addPrestige(player.getNType(getIcon()) * this.getPrestigeMul());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,14 @@ import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
/**
|
||||
* At the end of the game, you gain 25 Prestige Points.
|
||||
*/
|
||||
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
|
||||
* Creates a Building13 card with the specified era, price, and prestige value.
|
||||
*
|
||||
* @param era the era of the building card.
|
||||
* @param price the price of the building card.
|
||||
* @param prestigeValue the prestige value of the building card.
|
||||
*/
|
||||
public Building13(int era, int price,int prestigeValue) {
|
||||
super(era,price,prestigeValue);
|
||||
@@ -22,8 +20,9 @@ public class Building13 extends BuildingCard{
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to clone the building: it creates an exact copy.
|
||||
* @return the new copy of the building
|
||||
* Creates and returns a copy of this Building13 card.
|
||||
*
|
||||
* @return a clone of this Building13 card.
|
||||
*/
|
||||
@Override
|
||||
public BuildingCard clone() {
|
||||
@@ -31,9 +30,10 @@ public class Building13 extends BuildingCard{
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds 25 Prestige Points to the player
|
||||
* @param player the player who owns the building
|
||||
* @throws IllegalArgumentException thrown if the specified player does not own this building.
|
||||
* Applies the effect of this building card to the specified player.
|
||||
*
|
||||
* @param player the player to whom the effect is applied.
|
||||
* @throws IllegalArgumentException if the player does not own this building card.
|
||||
*/
|
||||
@Override
|
||||
public void applyEffect(Player player) throws IllegalArgumentException {
|
||||
@@ -42,4 +42,4 @@ public class Building13 extends BuildingCard{
|
||||
player.addPrestige(25);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user