Add: Javadoc for Character
This commit is contained in:
@@ -3,29 +3,75 @@ package it.polimi.ingsw.gc14.Model.Cards.TribeCards;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract base class for all character cards.
|
||||
* A Character is a {@link TribeCard} that is not an event card and is associated
|
||||
* with a specific {@link CharacterType}.
|
||||
*/
|
||||
public abstract class Character extends TribeCard implements Cloneable {
|
||||
|
||||
/**
|
||||
* The specific type of this character card.
|
||||
*/
|
||||
private CharacterType type;
|
||||
|
||||
/**
|
||||
* Returns the type of this character card.
|
||||
*
|
||||
* @return the type of this character card
|
||||
*/
|
||||
public CharacterType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a character card with the specified era and character type.
|
||||
*
|
||||
* @param Era the era of the character card
|
||||
* @param type the type of the character card
|
||||
*/
|
||||
public Character(int Era, CharacterType type){
|
||||
super(Era,false );
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a character card with the specified era, character type,
|
||||
* and minimum number of players.
|
||||
*
|
||||
* @param Era the era of the character card
|
||||
* @param type the type of the character card
|
||||
* @param nMin the minimum number of players required for the card
|
||||
*/
|
||||
public Character(int Era, CharacterType type,int nMin){
|
||||
super(Era,false ,nMin);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string representation of this character card.
|
||||
* The returned string includes the string representation of the superclass
|
||||
* and the string representation of the character type.
|
||||
*
|
||||
* @return the string representation of this character card
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString()+" "+type.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a copy of this character card.
|
||||
*
|
||||
* @return a clone of this character card
|
||||
*/
|
||||
@Override
|
||||
public abstract Character clone();
|
||||
|
||||
/**
|
||||
* Inserts this character card into the appropriate collection of the specified player.
|
||||
*
|
||||
* @param player the player who receives the character card
|
||||
*/
|
||||
public abstract void insert(Player player);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user