Add: Partial Implementation Of The toString Method And Test in Player.java And PlayerTest.java III.
This commit is contained in:
@@ -234,12 +234,12 @@ public class Player {
|
||||
+ "\n\tGatherers: " + this.gatherers.toString()
|
||||
+ "\n\tShamans: " + this.shamans.toString()
|
||||
+ "\n\tHunters: " + this.hunters.toString()
|
||||
+ "\n\tBuildings: \n";
|
||||
+ "\n\tBuildings: [\n";
|
||||
|
||||
for (BuildingCard buildingCard : this.buildingCards) {
|
||||
toPrint += buildingCard.toString().indent(8);
|
||||
toPrint += toPrint.replaceAll("\\n$", "") + "]";
|
||||
}
|
||||
|
||||
toPrint += "\t\t]";
|
||||
return toPrint;
|
||||
}
|
||||
// endregion functions
|
||||
|
||||
@@ -199,6 +199,8 @@ class PlayerTest {
|
||||
Player p = new Player("test_usr");
|
||||
p.addPrestige(15);
|
||||
p.addFood(7);
|
||||
p.artists.add(new Artist(1));
|
||||
p.artists.add(new Artist(2));
|
||||
p.buildingCards.add(new BuildingCard(1,2, 5));
|
||||
p.buildingCards.add(new BuildingCard(2,3, 6));
|
||||
System.out.println(p.toString());
|
||||
|
||||
Reference in New Issue
Block a user