Fix: Tui adapted to new input case
This commit is contained in:
@@ -62,7 +62,7 @@ public abstract class EventCard extends TribeCard {
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString()+" "+type.toString();
|
||||
return super.toString()+"(Event)"+type.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +77,7 @@ public abstract class EventCard extends TribeCard {
|
||||
*/
|
||||
@Override
|
||||
public String toStringBoard() {
|
||||
return super.toString()+" "+type.toString();
|
||||
return super.toString()+"(Event)"+type.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -793,9 +793,10 @@ public class Game implements Serializable {
|
||||
List<String> stringUpOffer=new ArrayList<>();
|
||||
List<String> stringDownOffer=new ArrayList<>();
|
||||
|
||||
int index=0;
|
||||
for(Map.Entry<Slot,Player> entry:slotMap.entrySet())
|
||||
{
|
||||
stringDownOffer.add(entry.getKey().toStringTUI());
|
||||
stringDownOffer.add((index++)+"."+entry.getKey().toStringTUI());
|
||||
if(entry.getValue()!=null)
|
||||
stringUpOffer.add(entry.getValue().getUserName());
|
||||
else
|
||||
@@ -813,11 +814,11 @@ public class Game implements Serializable {
|
||||
{
|
||||
if(i<getUpperListTribeCards().size())
|
||||
{
|
||||
stringUpperListTribe.add(getUpperListTribeCards().get(i).toStringBoard());
|
||||
stringUpperListTribe.add(i+"-"+getUpperListTribeCards().get(i).toStringBoard());
|
||||
}
|
||||
if(i<getLowerListTribeCards().size())
|
||||
{
|
||||
stringLowerListTribe.add(getLowerListTribeCards().get(i).toStringBoard());
|
||||
stringLowerListTribe.add(i+"-"+getLowerListTribeCards().get(i).toStringBoard());
|
||||
}
|
||||
}
|
||||
var BuildTableUpper = new AsciiTable(BorderStyle.UNICODE,1);
|
||||
@@ -829,11 +830,11 @@ public class Game implements Serializable {
|
||||
{
|
||||
if(i<getUpperListBuilding().size())
|
||||
{
|
||||
BuildTableUpper.addRow(getUpperListBuilding().get(i).toString());
|
||||
BuildTableUpper.addRow(i+"-"+getUpperListBuilding().get(i).toString());
|
||||
}
|
||||
if(i<getLowerListBuilding().size())
|
||||
{
|
||||
BuildTableLower.addRow(getLowerListBuilding().get(i).toString());
|
||||
BuildTableLower.addRow(i+"-"+getLowerListBuilding().get(i).toString());
|
||||
}
|
||||
}
|
||||
stringUpperListTribe.forEach(x->TribeTableUpper.addRow(x));
|
||||
|
||||
@@ -58,24 +58,19 @@ public class Order2 extends OrderLogicCard {
|
||||
|
||||
var table = new AsciiTable(BorderStyle.UNICODE, 2);
|
||||
List<String> stringUp=new ArrayList<>();
|
||||
List<String> stringDown=new ArrayList<>();
|
||||
for(int i=0;i<2;i++)
|
||||
{
|
||||
try {
|
||||
playerList.get(i);
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
if(playerList.get(i).played)
|
||||
stringDown.add(" Placed");
|
||||
stringUp.add(" ");
|
||||
else
|
||||
stringDown.add(" Not Placed");
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
}
|
||||
catch (IndexOutOfBoundsException e) {
|
||||
stringUp.add("");
|
||||
stringDown.add("");
|
||||
}
|
||||
}
|
||||
table.addRow(stringUp);
|
||||
table.addRow(stringDown);
|
||||
|
||||
List<String> stringList=new ArrayList<>();
|
||||
stringList.add("+1 Food");
|
||||
|
||||
@@ -60,24 +60,19 @@ public class Order3 extends OrderLogicCard {
|
||||
var table = new AsciiTable(BorderStyle.UNICODE, 3);
|
||||
|
||||
List<String> stringUp=new ArrayList<>();
|
||||
List<String> stringDown=new ArrayList<>();
|
||||
for(int i=0;i<3;i++)
|
||||
{
|
||||
try {
|
||||
playerList.get(i);
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
if(playerList.get(i).played)
|
||||
stringDown.add(" Placed");
|
||||
stringUp.add(" ");
|
||||
else
|
||||
stringDown.add(" Not Placed");
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
}
|
||||
catch (IndexOutOfBoundsException e) {
|
||||
stringUp.add("");
|
||||
stringDown.add("");
|
||||
}
|
||||
}
|
||||
table.addRow(stringUp);
|
||||
table.addRow(stringDown);
|
||||
|
||||
List<String> stringList=new ArrayList<>();
|
||||
|
||||
|
||||
@@ -66,24 +66,19 @@ public class Order4 extends OrderLogicCard {
|
||||
|
||||
var table = new AsciiTable(BorderStyle.UNICODE, 4);
|
||||
List<String> stringUp=new ArrayList<>();
|
||||
List<String> stringDown=new ArrayList<>();
|
||||
for(int i=0;i<4;i++)
|
||||
{
|
||||
try {
|
||||
playerList.get(i);
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
if(playerList.get(i).played)
|
||||
stringDown.add(" Placed");
|
||||
stringUp.add(" ");
|
||||
else
|
||||
stringDown.add(" Not Placed");
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
}
|
||||
catch (IndexOutOfBoundsException e) {
|
||||
stringUp.add("");
|
||||
stringDown.add("");
|
||||
}
|
||||
}
|
||||
table.addRow(stringUp);
|
||||
table.addRow(stringDown);
|
||||
|
||||
List<String> stringList=new ArrayList<>();
|
||||
stringList.add("+2 Food");
|
||||
|
||||
@@ -67,24 +67,19 @@ public class Order5 extends OrderLogicCard {
|
||||
|
||||
var table = new AsciiTable(BorderStyle.UNICODE, 5);
|
||||
List<String> stringUp=new ArrayList<>();
|
||||
List<String> stringDown=new ArrayList<>();
|
||||
for(int i=0;i<5;i++)
|
||||
{
|
||||
try {
|
||||
playerList.get(i);
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
if(playerList.get(i).played)
|
||||
stringDown.add(" Placed");
|
||||
stringUp.add(" ");
|
||||
else
|
||||
stringDown.add(" Not Placed");
|
||||
stringUp.add(i+". "+playerList.get(i).player.getUserName());
|
||||
}
|
||||
catch (IndexOutOfBoundsException e) {
|
||||
stringUp.add("");
|
||||
stringDown.add("");
|
||||
}
|
||||
}
|
||||
table.addRow(stringUp);
|
||||
table.addRow(stringDown);
|
||||
|
||||
List<String> stringList=new ArrayList<>();
|
||||
stringList.add("+3 Food");
|
||||
|
||||
@@ -172,7 +172,7 @@ public class Slot implements Serializable {
|
||||
public String toStringTUI()
|
||||
{
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append(this.getSlotId()+" ");
|
||||
//s.append(this.getSlotId()+" ");
|
||||
for(int i=0;i<this.getNUpper();i++)
|
||||
{
|
||||
s.append("↑");
|
||||
|
||||
Reference in New Issue
Block a user