Fix: complete refactor of TUI

Tests updated
This commit is contained in:
2026-06-10 22:15:32 +02:00
parent 8bd740e68a
commit 4ffe4c5352
31 changed files with 242 additions and 187 deletions
@@ -276,7 +276,7 @@ public class Player implements Serializable {
var table = new AsciiTable(ROUNDED, 1);
String totemStr = (this.totem != null) ? " (" + this.totem.toString() + ")" : "";
table.addHeader(this.getUserName() + totemStr + " | \uD83C\uDF56:" + this.getFoodValue() + " | \uD83C\uDFC5:" + this.getPrestigeValue() + " ");
table.addHeader(this.getUserName() + totemStr + " | \uD83C\uDF56:" + this.getFoodValue() + " | \uD83C\uDFC5:" + this.getPrestigeValue());
table.addSeparator();
if(!this.hunters.isEmpty()){
@@ -304,7 +304,7 @@ public class Player implements Serializable {
if(Last == 0){
table.addSeparator();
}
table.addRow("CHARACTERS:");
table.addRow("CHARACTERS");
if(!this.artists.isEmpty()){
table.addRow(this.artists.size() + " Artists: \uD83C\uDFA8:" + this.artists.size());
if(Last == 1){
@@ -313,7 +313,7 @@ public class Player implements Serializable {
}
if(!this.builders.isEmpty()){
table.addRow(this.builders.size() + " Builders: " + "-\uD83C\uDF56:" + this.builders.stream().mapToInt(Builder::getReductionValue).sum() + " \uD83C\uDFC5:" + this.builders.stream().mapToInt(Builder::getPrestigeValue).sum());
table.addRow(this.builders.size() + " Builders: " + "\uD83D\uDD28:" + this.builders.stream().mapToInt(Builder::getReductionValue).sum() + " \uD83C\uDFC5:" + this.builders.stream().mapToInt(Builder::getPrestigeValue).sum());
if(Last == 2){
table.addSeparator();
}
@@ -342,7 +342,7 @@ public class Player implements Serializable {
.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.map(e -> e.getKey() + ":" + e.getValue())
.collect(Collectors.joining(" ")));
.collect(Collectors.joining(", ")));
if(Last == 5){
table.addSeparator();
}
@@ -353,10 +353,13 @@ public class Player implements Serializable {
table.addRow(this.hunters.size() + " Hunters: \uD83C\uDF56" + this.hunters.stream().filter(Hunter::getIcon).count());
table.addSeparator();
}
table.addRow("BUILDING CARDS:");
table.addSeparator();
table.addRow("BUILDING CARDS" +
(this.buildingCards.stream().mapToInt(BuildingCard::getPrestigeValue).sum() != 0
? " 🏅:" + this.buildingCards.stream().mapToInt(BuildingCard::getPrestigeValue).sum()
: ""));
if(!this.buildingCards.isEmpty()){
table.addRow(this.buildingCards.size() + " Buildings: " + this.buildingCards.toString());
table.addRow(this.buildingCards.size() + " Buildings: " + this.buildingCards.stream().map(BuildingCard::toStringPlayer).collect(Collectors.joining(", ")));
}
return table.build();