Fix: Fixed "toString" Method Of Player.java.
This commit is contained in:
@@ -230,6 +230,8 @@ public class Player implements Serializable {
|
||||
// region Functions
|
||||
@Override
|
||||
public String toString() {
|
||||
int Last = 5;
|
||||
|
||||
var table = new AsciiTable(UNICODE, 1);
|
||||
|
||||
table.addHeader(this.getUserName());
|
||||
@@ -238,32 +240,64 @@ public class Player implements Serializable {
|
||||
table.addSeparator();
|
||||
table.addRow("Prestige: " + this.getPrestigeValue());
|
||||
|
||||
if(!this.hunters.isEmpty()){
|
||||
Last = 5;
|
||||
}
|
||||
else if(!this.shamans.isEmpty()){
|
||||
Last = 4;
|
||||
}
|
||||
else if(!this.gatherers.isEmpty()){
|
||||
Last = 3;
|
||||
}
|
||||
else if(!this.builders.isEmpty()){
|
||||
Last = 2;
|
||||
}
|
||||
else if(!this.inventors.isEmpty()){
|
||||
Last = 1;
|
||||
}
|
||||
else{
|
||||
Last = 0;
|
||||
}
|
||||
|
||||
if(Last == 0){
|
||||
table.addSeparator();
|
||||
}
|
||||
table.addRow("CHARACTERS:");
|
||||
if(!this.artists.isEmpty()){
|
||||
if(Last == 1){
|
||||
table.addSeparator();
|
||||
}
|
||||
table.addRow("Artists: " + this.artists.toString());
|
||||
}
|
||||
|
||||
if(!this.builders.isEmpty()){
|
||||
if(Last == 2){
|
||||
table.addSeparator();
|
||||
}
|
||||
table.addRow("Builders: " + this.builders.toString());
|
||||
}
|
||||
|
||||
if(!this.gatherers.isEmpty()){
|
||||
if(Last == 3){
|
||||
table.addSeparator();
|
||||
}
|
||||
table.addRow("Gatherers: " + this.gatherers.toString());
|
||||
}
|
||||
|
||||
if(!this.shamans.isEmpty()){
|
||||
if(Last == 4){
|
||||
table.addSeparator();
|
||||
}
|
||||
table.addRow("Shamans: " + this.shamans.toString());
|
||||
}
|
||||
|
||||
|
||||
if(!this.hunters.isEmpty()){
|
||||
table.addSeparator();
|
||||
table.addRow("Hunters: " + this.hunters.toString());
|
||||
}
|
||||
|
||||
//TODO fix ?
|
||||
table.addSeparator();
|
||||
table.addRow("BUILDING CARDS:");
|
||||
|
||||
if(!this.buildingCards.isEmpty()){
|
||||
table.addRow("Buildings: " + this.buildingCards.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user