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