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