Add: Partial Implementation Of The toString Method And Test in Player.java And PlayerTest.java II.
This commit is contained in:
@@ -226,14 +226,21 @@ public class Player {
|
||||
// TODO tostring usr + food + prestige \n tab foreach(characters.cards + spazio)
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getUserName() + ":\n\tFood: " + this.getFoodValue()
|
||||
String toPrint = "";
|
||||
toPrint = this.getUserName() + ":\n\tFood: " + this.getFoodValue()
|
||||
+ "\n\tPrestige: " + this.getPrestigeValue()
|
||||
+ "\n\tArtists: " + this.artists.toString()
|
||||
+ "\n\tBuilders: " + this.builders.toString()
|
||||
+ "\n\tGatherers: " + this.gatherers.toString()
|
||||
+ "\n\tShamans: " + this.shamans.toString()
|
||||
+ "\n\tHunters: " + this.hunters.toString()
|
||||
+ "\n\tBuildings:" + this.buildingCards.toString().indent(1);
|
||||
+ "\n\tBuildings: \n";
|
||||
for (BuildingCard buildingCard : this.buildingCards) {
|
||||
toPrint += buildingCard.toString().indent(8);
|
||||
toPrint += toPrint.replaceAll("\\n$", "") + "]";
|
||||
}
|
||||
|
||||
return toPrint;
|
||||
}
|
||||
// endregion functions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user