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.Cards.TribeCard;
|
||||||
import it.polimi.ingsw.gc14.Model.Player;
|
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 {
|
public abstract class Character extends TribeCard implements Cloneable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The specific type of this character card.
|
||||||
|
*/
|
||||||
private CharacterType type;
|
private CharacterType type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the type of this character card.
|
||||||
|
*
|
||||||
|
* @return the type of this character card
|
||||||
|
*/
|
||||||
public CharacterType getType() {
|
public CharacterType getType() {
|
||||||
return type;
|
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){
|
public Character(int Era, CharacterType type){
|
||||||
super(Era,false );
|
super(Era,false );
|
||||||
this.type = type;
|
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){
|
public Character(int Era, CharacterType type,int nMin){
|
||||||
super(Era,false ,nMin);
|
super(Era,false ,nMin);
|
||||||
this.type = type;
|
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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString()+" "+type.toString();
|
return super.toString()+" "+type.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and returns a copy of this character card.
|
||||||
|
*
|
||||||
|
* @return a clone of this character card
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public abstract Character clone();
|
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);
|
public abstract void insert(Player player);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user