Add: JavaDoc for Builder class
This commit is contained in:
@@ -6,19 +6,49 @@ import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
public class Builder extends Character
|
||||
{
|
||||
private int reductionValue;
|
||||
private int prestigeValue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Builder specific reduction value
|
||||
* The reduction valure provided by this Builder card.
|
||||
*/
|
||||
|
||||
private int reductionValue;
|
||||
|
||||
/**
|
||||
* The prestige value provided by this Builder card.
|
||||
*/
|
||||
|
||||
private int prestigeValue;
|
||||
|
||||
/**
|
||||
* Returns the reduction value of this Builder card.
|
||||
*
|
||||
* @return the reduction value of this Builder card
|
||||
*/
|
||||
|
||||
public int getReductionValue() {
|
||||
return reductionValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the prestige value of this Builder card.
|
||||
*
|
||||
* @return the prestige value of this Builder card
|
||||
*/
|
||||
|
||||
public int getPrestigeValue() {
|
||||
return prestigeValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Builder character card with the specified era, reduction value,
|
||||
* and prestige value.
|
||||
*
|
||||
* @param Era the era of the Builder card
|
||||
* @param reductionValue the reduction value of the Builder card
|
||||
* @param prestigeValue the prestige value of the Builder card
|
||||
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
|
||||
*/
|
||||
|
||||
public Builder(int Era, int reductionValue, int prestigeValue) throws IllegalArgumentException {
|
||||
super(Era,CharacterType.BUILDER);
|
||||
if(reductionValue < 0) {
|
||||
@@ -32,6 +62,18 @@ public class Builder extends Character
|
||||
this.prestigeValue = prestigeValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Builder character card with the specified era, reduction value,
|
||||
* prestige value, and minimum number of players.
|
||||
*
|
||||
* @param Era the era of the Builder card
|
||||
* @param reductionValue the reduction value of the Builder card
|
||||
* @param prestigeValue the prestige value of the Builder card
|
||||
* @param nMin the minimum number of players required for the card
|
||||
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
|
||||
*/
|
||||
|
||||
|
||||
public Builder(int Era, int reductionValue, int prestigeValue,int nMin) throws IllegalArgumentException {
|
||||
super(Era,CharacterType.BUILDER,nMin);
|
||||
if(reductionValue < 0) {
|
||||
@@ -44,14 +86,33 @@ public class Builder extends Character
|
||||
}
|
||||
this.prestigeValue = prestigeValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string representation of this Builder card.
|
||||
*
|
||||
* @return the string representation of this Builder card
|
||||
*/
|
||||
|
||||
@Override
|
||||
public String toString() { return super.toString()+" Reduction Value: " + String.valueOf(reductionValue) + "\n Prestige Value: " + String.valueOf(prestigeValue); }
|
||||
|
||||
/**
|
||||
* Creates and returns a copy of this Builder card.
|
||||
*
|
||||
* @return a clone of this Builder card
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Character clone() {
|
||||
return new Builder(getEra(),getReductionValue(), getPrestigeValue(), getNMin());
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts this Builder card into the specified player's Builder collection.
|
||||
*
|
||||
* @param player the player who receives the card
|
||||
*/
|
||||
|
||||
public void insert(Player player) {
|
||||
player.builders.add(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user