Add: Added toString To Player.java + Respective Tests And Fixed BuildingCard.java's toString.

This commit is contained in:
GabrieleRadice
2026-04-17 16:04:43 +02:00
parent 2da6642468
commit 6d0235c046
3 changed files with 14 additions and 9 deletions
@@ -227,19 +227,16 @@ public class Player {
@Override
public String toString() {
String toPrint = "";
toPrint = this.getUserName() + ":\n\tFood: " + this.getFoodValue()
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: [\n";
for (BuildingCard buildingCard : this.buildingCards) {
toPrint += buildingCard.toString().indent(8);
}
toPrint += "\t\t]";
+ "\n\tBuildings: "
+ this.buildingCards.toString();
return toPrint;
}
// endregion functions