Add: JavaDoc for Builder class
This commit is contained in:
@@ -30,7 +30,6 @@ public class Artist extends Character {
|
|||||||
*
|
*
|
||||||
* @return the string representation of this Artist card
|
* @return the string representation of this Artist card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString();
|
return super.toString();
|
||||||
@@ -41,7 +40,6 @@ public class Artist extends Character {
|
|||||||
*
|
*
|
||||||
* @return a clone of this Artist card
|
* @return a clone of this Artist card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Character clone() {
|
public Character clone() {
|
||||||
return new Artist(getEra(), getNMin());
|
return new Artist(getEra(), getNMin());
|
||||||
@@ -52,7 +50,6 @@ public class Artist extends Character {
|
|||||||
*
|
*
|
||||||
* @param player the player who receives the card
|
* @param player the player who receives the card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insert(Player player) {
|
public void insert(Player player) {
|
||||||
player.artists.add(this);
|
player.artists.add(this);
|
||||||
|
|||||||
@@ -10,13 +10,11 @@ public class Builder extends Character
|
|||||||
/**
|
/**
|
||||||
* The reduction valure provided by this Builder card.
|
* The reduction valure provided by this Builder card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private int reductionValue;
|
private int reductionValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The prestige value provided by this Builder card.
|
* The prestige value provided by this Builder card.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private int prestigeValue;
|
private int prestigeValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,7 +22,6 @@ public class Builder extends Character
|
|||||||
*
|
*
|
||||||
* @return the reduction value of this Builder card
|
* @return the reduction value of this Builder card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public int getReductionValue() {
|
public int getReductionValue() {
|
||||||
return reductionValue;
|
return reductionValue;
|
||||||
}
|
}
|
||||||
@@ -34,7 +31,6 @@ public class Builder extends Character
|
|||||||
*
|
*
|
||||||
* @return the prestige value of this Builder card
|
* @return the prestige value of this Builder card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public int getPrestigeValue() {
|
public int getPrestigeValue() {
|
||||||
return prestigeValue;
|
return prestigeValue;
|
||||||
}
|
}
|
||||||
@@ -48,7 +44,6 @@ public class Builder extends Character
|
|||||||
* @param prestigeValue the prestige value of the Builder card
|
* @param prestigeValue the prestige value of the Builder card
|
||||||
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
|
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public Builder(int Era, int reductionValue, int prestigeValue) throws IllegalArgumentException {
|
public Builder(int Era, int reductionValue, int prestigeValue) throws IllegalArgumentException {
|
||||||
super(Era,CharacterType.BUILDER);
|
super(Era,CharacterType.BUILDER);
|
||||||
if(reductionValue < 0) {
|
if(reductionValue < 0) {
|
||||||
@@ -72,8 +67,6 @@ public class Builder extends Character
|
|||||||
* @param nMin the minimum number of players required for the card
|
* @param nMin the minimum number of players required for the card
|
||||||
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
|
* @throws IllegalArgumentException if {@code reductionValue < 0} or {@code prestigeValue < 0}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public Builder(int Era, int reductionValue, int prestigeValue,int nMin) throws IllegalArgumentException {
|
public Builder(int Era, int reductionValue, int prestigeValue,int nMin) throws IllegalArgumentException {
|
||||||
super(Era,CharacterType.BUILDER,nMin);
|
super(Era,CharacterType.BUILDER,nMin);
|
||||||
if(reductionValue < 0) {
|
if(reductionValue < 0) {
|
||||||
@@ -92,7 +85,6 @@ public class Builder extends Character
|
|||||||
*
|
*
|
||||||
* @return the string representation of this Builder card
|
* @return the string representation of this Builder card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() { return super.toString()+" Reduction Value: " + String.valueOf(reductionValue) + "\n Prestige Value: " + String.valueOf(prestigeValue); }
|
public String toString() { return super.toString()+" Reduction Value: " + String.valueOf(reductionValue) + "\n Prestige Value: " + String.valueOf(prestigeValue); }
|
||||||
|
|
||||||
@@ -101,7 +93,6 @@ public class Builder extends Character
|
|||||||
*
|
*
|
||||||
* @return a clone of this Builder card
|
* @return a clone of this Builder card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Character clone() {
|
public Character clone() {
|
||||||
return new Builder(getEra(),getReductionValue(), getPrestigeValue(), getNMin());
|
return new Builder(getEra(),getReductionValue(), getPrestigeValue(), getNMin());
|
||||||
@@ -112,7 +103,6 @@ public class Builder extends Character
|
|||||||
*
|
*
|
||||||
* @param player the player who receives the card
|
* @param player the player who receives the card
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public void insert(Player player) {
|
public void insert(Player player) {
|
||||||
player.builders.add(this);
|
player.builders.add(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,24 +7,49 @@ import it.polimi.ingsw.gc14.Model.Player;
|
|||||||
public class Gatherer extends Character {
|
public class Gatherer extends Character {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Creates a Gatherer character card with the specified era.
|
||||||
*
|
*
|
||||||
* @param Era gatherers era
|
* @param Era Gatherers era
|
||||||
*/
|
*/
|
||||||
public Gatherer(int Era) {
|
public Gatherer(int Era) {
|
||||||
super(Era, CharacterType.GATHERER);
|
super(Era, CharacterType.GATHERER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a Gatherer character card with the specified era and minimum number of players.
|
||||||
|
*
|
||||||
|
* @param Era the era of the Gatherer card
|
||||||
|
* @param nMin the minimum number of players required for the card
|
||||||
|
*/
|
||||||
public Gatherer(int Era, int nMin) {
|
public Gatherer(int Era, int nMin) {
|
||||||
super(Era, CharacterType.GATHERER,nMin);
|
super(Era, CharacterType.GATHERER,nMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string representation of this Gatherer card.
|
||||||
|
*
|
||||||
|
* @return the string representation of this Gatherer card
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString();
|
return super.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates and returns a copy of this Gatherer card.
|
||||||
|
*
|
||||||
|
* @return a clone of this Gatherer card
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Character clone() {
|
public Character clone() {
|
||||||
return new Gatherer(getEra(), getNMin());
|
return new Gatherer(getEra(), getNMin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts this Gatherer card into the specified player's Gatherer collection.
|
||||||
|
*
|
||||||
|
* @param player the player who receives the card
|
||||||
|
*/
|
||||||
public void insert(Player player) {
|
public void insert(Player player) {
|
||||||
player.gatherers.add(this);
|
player.gatherers.add(this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user