|
|
@ -29,8 +29,7 @@ public class Gameboard { |
|
|
|
|
|
|
|
|
|
|
|
public String printBoard(Game g) { |
|
|
|
String[] f; |
|
|
|
f = getFiguresOnBoard(g); |
|
|
|
String[] f = getFiguresOnBoard(g); |
|
|
|
return "" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ +---+ +---+ "+ YELLOW +"+---+ +---+\n" + |
|
|
|
BLUE +"| "+ f[60] + BLUE +" | | "+ f[61] + BLUE +" |"+ RESET +" | "+ f[18] +" | | "+ f[19] +" | | "+ f[20] +" | "+ YELLOW +"| "+ f[64] +" | | "+ f[65] +" |\n" + |
|
|
@ -75,29 +74,32 @@ public class Gameboard { |
|
|
|
public String[] getFiguresOnBoard(Game g) { |
|
|
|
String[] res = new String[72]; |
|
|
|
Arrays.fill(res, " "); |
|
|
|
Iterator<Player> pIt = g.players.iterator(); |
|
|
|
while(pIt.hasNext()) { |
|
|
|
Player p = pIt.next(); |
|
|
|
String color = new String(); |
|
|
|
for (Player p : g.players) { |
|
|
|
String color = ""; |
|
|
|
int start = 0; |
|
|
|
if(p.name.equals("Rot")) { |
|
|
|
color = RED; |
|
|
|
start = 56; |
|
|
|
} else if (p.name.equals("Blau")) { |
|
|
|
color = BLUE; |
|
|
|
start = 60; |
|
|
|
} else if (p.name.equals("Gelb")) { |
|
|
|
color = YELLOW; |
|
|
|
start = 64; |
|
|
|
} else if (p.name.equals("Grün")) { |
|
|
|
color = GREEN; |
|
|
|
start = 68; |
|
|
|
switch (p.name) { |
|
|
|
case "Rot" -> { |
|
|
|
color = RED; |
|
|
|
start = 56; |
|
|
|
} |
|
|
|
case "Blau" -> { |
|
|
|
color = BLUE; |
|
|
|
start = 60; |
|
|
|
} |
|
|
|
case "Gelb" -> { |
|
|
|
color = YELLOW; |
|
|
|
start = 64; |
|
|
|
} |
|
|
|
case "Grün" -> { |
|
|
|
color = GREEN; |
|
|
|
start = 68; |
|
|
|
} |
|
|
|
} |
|
|
|
Iterator<Figure> figureIt = p.figures.iterator(); |
|
|
|
int i = 1; |
|
|
|
while (figureIt.hasNext()) { |
|
|
|
Figure f = figureIt.next(); |
|
|
|
if(f.getPosition() == -1) { |
|
|
|
if (f.getPosition() == -1) { |
|
|
|
res[start++] = color + i + RESET; |
|
|
|
i++; |
|
|
|
} else { |
|
|
|