Add: Javadoc for TribeCard
This commit is contained in:
@@ -3,24 +3,71 @@ package it.polimi.ingsw.gc14.Model.Cards;
|
|||||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||||
import it.polimi.ingsw.gc14.Model.PlayableCard;
|
import it.polimi.ingsw.gc14.Model.PlayableCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract base class for all tribe cards.
|
||||||
|
* A TribeCard is a {@link PlayableCard} that may either be an event card
|
||||||
|
* or a non-event card, and may optionally specify a minimum number of players.
|
||||||
|
*/
|
||||||
public abstract class TribeCard extends PlayableCard {
|
public abstract class TribeCard extends PlayableCard {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether this tribe card is an event card.
|
||||||
|
*/
|
||||||
private boolean isEventCard;
|
private boolean isEventCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether this tribe card is an event card.
|
||||||
|
*
|
||||||
|
* @return {@code true} if this card is an event card, {@code false} otherwise
|
||||||
|
*/
|
||||||
public boolean IsEventCard() {
|
public boolean IsEventCard() {
|
||||||
return isEventCard;
|
return isEventCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The minimum number of players required for this tribe card.
|
||||||
|
*/
|
||||||
private int nMin=0;
|
private int nMin=0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the minimum number of players required for this tribe card.
|
||||||
|
*
|
||||||
|
* @return the minimum number of players required for this tribe card
|
||||||
|
*/
|
||||||
public int getNMin() {
|
public int getNMin() {
|
||||||
return nMin;
|
return nMin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a tribe card with the specified era and event-card flag.
|
||||||
|
* The minimum number of players is set to 0.
|
||||||
|
*
|
||||||
|
* @param Era the era of the tribe card
|
||||||
|
* @param isEventCard whether the card is an event card
|
||||||
|
*/
|
||||||
public TribeCard(int Era,boolean isEventCard) {
|
public TribeCard(int Era,boolean isEventCard) {
|
||||||
this(Era,isEventCard,0);
|
this(Era,isEventCard,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a tribe card with the specified era, event-card flag,
|
||||||
|
* and minimum number of players.
|
||||||
|
*
|
||||||
|
* @param Era the era of the tribe card
|
||||||
|
* @param isEventCard whether the card is an event card
|
||||||
|
* @param nMin the minimum number of players required for the card
|
||||||
|
*/
|
||||||
public TribeCard(int Era,boolean isEventCard,int nMin) {
|
public TribeCard(int Era,boolean isEventCard,int nMin) {
|
||||||
super(Era);
|
super(Era);
|
||||||
this.nMin=nMin;
|
this.nMin=nMin;
|
||||||
this.isEventCard=isEventCard;
|
this.isEventCard=isEventCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and returns a copy of this tribe card.
|
||||||
|
*
|
||||||
|
* @return a clone of this tribe card
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public abstract TribeCard clone();
|
public abstract TribeCard clone();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user