Add: Javadoc for CavePaintings class
This commit is contained in:
@@ -11,9 +11,30 @@ import it.polimi.ingsw.gc14.Model.Player;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class CavePaintings extends EventCard {
|
public class CavePaintings extends EventCard {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The minimum number of Artist cards required to avoid the prestige penalty.
|
||||||
|
*/
|
||||||
private int NLower;
|
private int NLower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The amount of Prestige removed if the player has fewer Artist cards than {@code NLower}.
|
||||||
|
*/
|
||||||
private int NPrestigeRem; // NPrestigeLower
|
private int NPrestigeRem; // NPrestigeLower
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Prestige multiplier applied if the player has at least {@code NLower} Artist cards.
|
||||||
|
*/
|
||||||
private int NPrestigeMul; // NPrestigeUpper
|
private int NPrestigeMul; // NPrestigeUpper
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a CavePaintings event card with the specified era and effect parameters.
|
||||||
|
*
|
||||||
|
* @param Era the era of the event card.
|
||||||
|
* @param NLower the minimum number of Artist cards required to avoid the prestige penalty.
|
||||||
|
* @param NPrestigeRem the amount of Prestige removed if the player has fewer Artist cards than {@code NLower}.
|
||||||
|
* @param NPrestigeMul the Prestige multiplier applied if the player has at least {@code NLower} Artist cards.
|
||||||
|
*/
|
||||||
public CavePaintings(int Era, int NLower, int NPrestigeRem, int NPrestigeMul) {
|
public CavePaintings(int Era, int NLower, int NPrestigeRem, int NPrestigeMul) {
|
||||||
super(Era, EventType.CAVE_PAINTINGS);
|
super(Era, EventType.CAVE_PAINTINGS);
|
||||||
this.NLower = NLower;
|
this.NLower = NLower;
|
||||||
@@ -21,6 +42,16 @@ public class CavePaintings extends EventCard {
|
|||||||
this.NPrestigeMul = NPrestigeMul;
|
this.NPrestigeMul = NPrestigeMul;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 than {@code NLower}, the player loses {@code NPrestigeRem} Prestige.
|
||||||
|
* Otherwise, the player gains Prestige equal to {@code NPrestigeMul} multiplied by the number of Artist cards.
|
||||||
|
*
|
||||||
|
* @param playerList the list of players affected by the event.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void activateEvent (ArrayList <Player> playerList){
|
public void activateEvent (ArrayList <Player> playerList){
|
||||||
for (Player player : playerList){
|
for (Player player : playerList){
|
||||||
@@ -42,6 +73,12 @@ public class CavePaintings extends EventCard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and returns a copy of this CavePaintings event card.
|
||||||
|
*
|
||||||
|
* @return a clone of this CavePaintings event card.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public EventCard clone()
|
public EventCard clone()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user