Add: JavaDoc for Hunter class
This commit is contained in:
@@ -4,40 +4,67 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
|||||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
import it.polimi.ingsw.gc14.Model.Player;
|
import it.polimi.ingsw.gc14.Model.Player;
|
||||||
|
|
||||||
public class Hunter extends Character {
|
public class Hunter extends Character {
|
||||||
private boolean icon;
|
private boolean icon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Returns whether this Hunter card has the icon.
|
||||||
*
|
*
|
||||||
* @return Hunter specific icon
|
* @return {@code true} if this Hunter card has the icon, {@code false} otherwise
|
||||||
*/
|
*/
|
||||||
public boolean getIcon() {
|
public boolean getIcon() {
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Creates a Hunter character card with the specified era and icon value.
|
||||||
*
|
*
|
||||||
* @param Era hunter era
|
* @param Era the era of the Hunter card
|
||||||
* @param icon hunter icon
|
* @param icon the icon value of the Hunter card
|
||||||
*/
|
*/
|
||||||
public Hunter(int Era, boolean icon) {
|
public Hunter(int Era, boolean icon) {
|
||||||
super(Era, CharacterType.HUNTER);
|
super(Era, CharacterType.HUNTER);
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Hunter character card with the specified era, icon value,
|
||||||
|
* and minimum number of players.
|
||||||
|
*
|
||||||
|
* @param Era the era of the Hunter card
|
||||||
|
* @param icon the icon value of the Hunter card
|
||||||
|
* @param nMin the minimum number of players required for the card
|
||||||
|
*/
|
||||||
public Hunter(int Era, boolean icon, int nMin) {
|
public Hunter(int Era, boolean icon, int nMin) {
|
||||||
super(Era, CharacterType.HUNTER,nMin);
|
super(Era, CharacterType.HUNTER,nMin);
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string representation of this Hunter card.
|
||||||
|
*
|
||||||
|
* @return the string representation of this Hunter card
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString() + "Icon: " + String.valueOf(icon);
|
return super.toString() + "Icon: " + String.valueOf(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and returns a copy of this Hunter card.
|
||||||
|
*
|
||||||
|
* @return a clone of this Hunter card
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Character clone() {
|
public Character clone() {
|
||||||
return new Hunter(getEra(), getIcon(), getNMin());
|
return new Hunter(getEra(), getIcon(), getNMin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts this Hunter card into the specified player's Hunter collection.
|
||||||
|
*
|
||||||
|
* @param player the player who receives the card
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insert(Player player) {
|
public void insert(Player player) {
|
||||||
player.hunters.add(this);
|
player.hunters.add(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user