Fix: TUI
This commit is contained in:
@@ -60,6 +60,12 @@ public abstract class Character extends TribeCard implements Cloneable {
|
|||||||
return super.toString();
|
return super.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toStringBoard()
|
||||||
|
{
|
||||||
|
return super.toStringBoard()+" "+getType().toString()+" ";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns a copy of this character card.
|
* Creates and returns a copy of this character card.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -89,6 +89,12 @@ public class Builder extends Character
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString() + " RV:" + String.valueOf(reductionValue) + " PV:" + String.valueOf(prestigeValue);
|
return super.toString() + " RV:" + String.valueOf(reductionValue) + " PV:" + String.valueOf(prestigeValue);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toStringBoard()
|
||||||
|
{
|
||||||
|
return super.toStringBoard()+" "+ " RV:" + String.valueOf(reductionValue) + " PV:" + String.valueOf(prestigeValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns a copy of this Builder card.
|
* Creates and returns a copy of this Builder card.
|
||||||
|
|||||||
@@ -53,6 +53,15 @@ public class Hunter extends Character {
|
|||||||
}
|
}
|
||||||
return toPrint;
|
return toPrint;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
String toPrint = super.toStringBoard();
|
||||||
|
if(this.icon){
|
||||||
|
toPrint += " I";
|
||||||
|
}
|
||||||
|
return toPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns a copy of this Hunter card.
|
* Creates and returns a copy of this Hunter card.
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ public class Inventor extends Character {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString() + " I_ID:" + String.valueOf(icon);
|
return super.toString() + " I_ID:" + String.valueOf(icon);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
return super.toStringBoard() + " I_ID:" + String.valueOf(icon);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns a copy of this Inventor card.
|
* Creates and returns a copy of this Inventor card.
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ public class Shaman extends Character {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString() + " *:" + String.valueOf(icon);
|
return super.toString() + " *:" + String.valueOf(icon);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
return super.toStringBoard() + " *:" + String.valueOf(icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns a copy of this Shaman card.
|
* Creates and returns a copy of this Shaman card.
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ public abstract class EventCard extends TribeCard {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return super.toString()+", "+type.toString();
|
return super.toString()+" "+type.toString();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
return super.toString()+" "+type.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -85,4 +85,9 @@ public class CavePaintings extends EventCard {
|
|||||||
{
|
{
|
||||||
return new CavePaintings(getEra(), NLower, NPrestigeRem, NPrestigeMul) ;
|
return new CavePaintings(getEra(), NLower, NPrestigeRem, NPrestigeMul) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
return super.toString()+" 0-"+(NLower-1)+":"+NPrestigeRem+" "+NLower+"+:"+NPrestigeMul;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,5 +70,9 @@ public class Hunt extends EventCard {
|
|||||||
public EventCard clone() {
|
public EventCard clone() {
|
||||||
return new Hunt(getEra(), prestigeMultiplier);
|
return new Hunt(getEra(), prestigeMultiplier);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
return super.toString()+" 1F+"+prestigeMultiplier+"PP"+" X N Hunter";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -96,6 +96,9 @@ public class ShamanicRitual extends EventCard {
|
|||||||
public EventCard clone() {
|
public EventCard clone() {
|
||||||
return new ShamanicRitual(getEra(), prestigeToAdd, prestigeToRemove);
|
return new ShamanicRitual(getEra(), prestigeToAdd, prestigeToRemove);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
return super.toString()+" *>:"+prestigeToAdd+" *<:"+prestigeToRemove;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,4 +89,9 @@ public class Sustenance extends EventCard {
|
|||||||
public EventCard clone() {
|
public EventCard clone() {
|
||||||
return new Sustenance(getEra(), PrestigeDebt);
|
return new Sustenance(getEra(), PrestigeDebt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toStringBoard() {
|
||||||
|
return super.toString()+" -1F/-"+PrestigeDebt+"PP";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -721,21 +721,72 @@ public class Game implements Serializable {
|
|||||||
table.addRow(stringUp);
|
table.addRow(stringUp);
|
||||||
table.addRow(stringEmpty);
|
table.addRow(stringEmpty);
|
||||||
table.addRow(stringDown);
|
table.addRow(stringDown);
|
||||||
StringBuilder s=new StringBuilder();
|
|
||||||
List<String>tempLines=new ArrayList<>();
|
|
||||||
List<List<String>> playersString=new ArrayList<>();
|
|
||||||
for(Player p:playersList)
|
|
||||||
{
|
|
||||||
tempLines=List.of(p.toString().split("\n"));
|
|
||||||
playersString.add(tempLines);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
List<String>lines=List.of(orderLogicCard.toString().split("\n"));
|
List<String>lines=List.of(orderLogicCard.toString().split("\n"));
|
||||||
List<String> lines2=new ArrayList<>();
|
List<String> lines2=new ArrayList<>();
|
||||||
lines2.add("OFFER TRACK");
|
lines2.add("OFFER TRACK");
|
||||||
lines2.addAll(List.of(table.build().split("\n")));
|
lines2.addAll(List.of(table.build().split("\n")));
|
||||||
return AsciiTable.sideBySide(lines,lines2,1)+AsciiTable.sideBySide(playersString.get(0),playersString.get(1),1);
|
|
||||||
|
String boardToString=AsciiTable.sideBySide(lines,lines2,1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var table2 = new AsciiTable(BorderStyle.UNICODE, Math.max(getUpperListTribeCards().size(),getLowerListTribeCards().size()));
|
||||||
|
List<String> stringUp2=new ArrayList<>();
|
||||||
|
List<String> stringDown2=new ArrayList<>();
|
||||||
|
for(int i=0;i<Math.max(getUpperListTribeCards().size(),getLowerListTribeCards().size());i++)
|
||||||
|
{
|
||||||
|
if(i<getUpperListTribeCards().size())
|
||||||
|
{
|
||||||
|
stringUp2.add(getUpperListTribeCards().get(i).toStringBoard());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stringUp2.add("");
|
||||||
|
}
|
||||||
|
if(i<getLowerListTribeCards().size())
|
||||||
|
{
|
||||||
|
stringDown2.add(getLowerListTribeCards().get(i).toStringBoard());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stringDown2.add("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
table2.addRow(stringUp2);
|
||||||
|
table2.addRow(stringDown2);
|
||||||
|
|
||||||
|
var table3 = new AsciiTable(BorderStyle.UNICODE, Math.max(getUpperListBuilding().size(),getLowerListBuilding().size()));
|
||||||
|
List<String> stringUp3=new ArrayList<>();
|
||||||
|
List<String> stringDown3=new ArrayList<>();
|
||||||
|
for(int i=0;i<Math.max(getUpperListBuilding().size(),getLowerListBuilding().size());i++)
|
||||||
|
{
|
||||||
|
if(i<getUpperListBuilding().size())
|
||||||
|
{
|
||||||
|
stringUp3.add(getUpperListBuilding().get(i).toString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stringUp3.add("-");
|
||||||
|
}
|
||||||
|
if(i<getLowerListBuilding().size())
|
||||||
|
{
|
||||||
|
stringDown3.add(getLowerListBuilding().get(i).toString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stringDown3.add("-");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
table3.addRow(stringUp3);
|
||||||
|
table3.addRow(stringDown3);
|
||||||
|
|
||||||
|
String PlayerToString ="";
|
||||||
|
for(Player p:playersList)
|
||||||
|
{
|
||||||
|
PlayerToString+=p.toString()+"\n";
|
||||||
|
}
|
||||||
|
return PlayerToString+"\n"+ boardToString +"UPPERList\\LOWERList\n"+table2.build() + "\nBUILDING\n"+table3.build() + "\n";
|
||||||
//return s.toString()+"\n"++"\nOFFER TRACK\n"+ table.build()+"\n" ;
|
//return s.toString()+"\n"++"\nOFFER TRACK\n"+ table.build()+"\n" ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,4 +45,8 @@ public abstract class PlayableCard implements Serializable {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return "⎕:";
|
return "⎕:";
|
||||||
}
|
}
|
||||||
|
public String toStringBoard()
|
||||||
|
{
|
||||||
|
return "⎕:";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,6 +216,6 @@ class GameTest {
|
|||||||
players.add( game.getCurrentState().getCurrentPlayer());
|
players.add( game.getCurrentState().getCurrentPlayer());
|
||||||
assertTrue(game.SlotChoiceByIndex(game.getCurrentState().getCurrentPlayer(), i));
|
assertTrue(game.SlotChoiceByIndex(game.getCurrentState().getCurrentPlayer(), i));
|
||||||
}
|
}
|
||||||
//System.out.println(game);
|
System.out.println(game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user