Class CavePaintings
java.lang.Object
it.polimi.ingsw.gc14.Model.PlayableCard
it.polimi.ingsw.gc14.Model.Cards.TribeCard
it.polimi.ingsw.gc14.Model.Cards.TribeCards.EventCard
it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events.CavePaintings
- All Implemented Interfaces:
Serializable
Represents a Cave Paintings event card.
This class defines the specific behavior of the Cave Paintings event.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe minimum number of Artist cards required to avoid the prestige penalty.private final intThe Prestige multiplier applied if the player has at leastnLowerArtist cards.private final intThe amount of Prestige removed if the player has fewer Artist cards thannLower. -
Constructor Summary
ConstructorsConstructorDescriptionCavePaintings(int Era, int nLower, int nPrestigeRem, int nPrestigeMul) Creates a CavePaintings event card with the specified era and effect parameters.CavePaintings(String idIMG, int Era, int nLower, int nPrestigeRem, int nPrestigeMul) Creates a CavePaintings event card with the specified image id, era and effect parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateEvent(ArrayList<Player> playerList) Activates the CavePaintings event for the specified list of players.clone()Creates and returns a copy of this CavePaintings event card.Returns the representation shown on the board (offer track cards).Prints a string representation of thisTribeCard.Methods inherited from class TribeCard
getNMin, isEventCardMethods inherited from class PlayableCard
getEra, getIdIMG
-
Field Details
-
nLower
private final int nLowerThe minimum number of Artist cards required to avoid the prestige penalty. Also, the bottom number on the card. -
nPrestigeRem
private final int nPrestigeRemThe amount of Prestige removed if the player has fewer Artist cards thannLower. -
nPrestigeMul
private final int nPrestigeMulThe Prestige multiplier applied if the player has at leastnLowerArtist cards.
-
-
Constructor Details
-
CavePaintings
public CavePaintings(int Era, int nLower, int nPrestigeRem, int nPrestigeMul) Creates a CavePaintings event card with the specified era and effect parameters.- Parameters:
Era- the era of the event card.nLower- the minimum number of Artist cards required to avoid the prestige penalty.nPrestigeRem- the amount of Prestige removed if the player has fewer Artist cards thannLower.nPrestigeMul- the Prestige multiplier applied if the player has at leastnLowerArtist cards.
-
CavePaintings
Creates a CavePaintings event card with the specified image id, era and effect parameters.- Parameters:
idIMG- the image identifier of the CavePaintings event card.Era- the era of the event card.nLower- the minimum number of Artist cards required to avoid the prestige penalty.nPrestigeRem- the amount of Prestige removed if the player has fewer Artist cards thannLower.nPrestigeMul- the Prestige multiplier applied if the player has at leastnLowerArtist cards.
-
-
Method Details
-
activateEvent
Activates the CavePaintings event for the specified list of players. For each player, the number of Artist cards is computed together with the number of owned building cards having effect id equal to 9. The player gains Food equal to the number of such buildings multiplied by the number of Artist cards. If the player has fewer Artist cards thannLower, the player losesnPrestigeRemPrestige. Otherwise, the player gains Prestige equal tonPrestigeMulmultiplied by the number of Artist cards.- Specified by:
activateEventin classEventCard- Parameters:
playerList- the list of players affected by the event.
-
clone
-
toStringPlayer
Prints a string representation of thisTribeCard. This specific variation is used in theGame's toString to print a more detailed version.NOTE:
Includes:NUpperis not a real attribute used in calculations (onlynLoweris needed), however it's a parameter on the cards' design.nLowerNUppernPrestigeRemnPrestigeMul
- Specified by:
toStringPlayerin classPlayableCard- Returns:
String- a string representation of thisTribeCard.- See Also:
-
toStringBoard
Description copied from class:PlayableCardReturns the representation shown on the board (offer track cards).- Specified by:
toStringBoardin classPlayableCard- Returns:
- the board string representation of this card.
-