|
|
@ -28,8 +28,9 @@ public class Gameboard { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String printBoard(Game g, Player p) { |
|
|
|
public String printBoard(Game g, Player p, int dice) { |
|
|
|
String[] f = getFiguresOnBoard(g); |
|
|
|
String[] d = getDice(dice); |
|
|
|
String color = ""; |
|
|
|
switch (p.name) { |
|
|
|
case "Rot" -> color = RED; |
|
|
@ -38,11 +39,11 @@ public class Gameboard { |
|
|
|
case "Grün" -> color = GREEN; |
|
|
|
} |
|
|
|
return "" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ +---+ +---+ "+ YELLOW +"+---+ +---+\n" + |
|
|
|
BLUE +"| "+ f[60] + BLUE +" | | "+ f[61] + BLUE +" |"+ RESET +" | "+ f[18] +" | | "+ f[19] +" | | "+ f[20] +" | "+ YELLOW +"| "+ f[64] + YELLOW + " | | "+ f[65] + YELLOW +" |\n" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ +---+ +---+ "+ YELLOW +"+---+ +---+\n" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ "+ YELLOW +"+---+"+ RESET +" +---+ "+ YELLOW +"+---+ +---+\n" + |
|
|
|
BLUE +"| "+ f[62] + BLUE + " | | "+ f[63] + BLUE +" |"+ RESET +" | "+ f[17] +" | "+ YELLOW +" | "+ f[48] + YELLOW +" | "+ RESET +" | "+ f[21] +" | "+ YELLOW +"| "+ f[66] + YELLOW +" | | "+ f[67] + YELLOW +" |\n" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ +---+ +---+ "+ YELLOW +"+---+ +---+"+ RESET +" ---------\n" + |
|
|
|
BLUE +"| "+ f[60] + BLUE +" | | "+ f[61] + BLUE +" |"+ RESET +" | "+ f[18] +" | | "+ f[19] +" | | "+ f[20] +" | "+ YELLOW +"| "+ f[64] + YELLOW + " | | "+ f[65] + YELLOW +" | "+ RESET + " | "+ d[0] +" "+ d[1] +" "+ d[2] +" |\n" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ +---+ +---+ "+ YELLOW +"+---+ +---+"+ RESET +" | "+ d[3] +" |\n" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ "+ YELLOW +"+---+"+ RESET +" +---+ "+ YELLOW +"+---+ +---+"+ RESET +" | "+d[4]+" "+d[5]+" "+d[6]+" |\n" + |
|
|
|
BLUE +"| "+ f[62] + BLUE + " | | "+ f[63] + BLUE +" |"+ RESET +" | "+ f[17] +" | "+ YELLOW +" | "+ f[48] + YELLOW +" | "+ RESET +" | "+ f[21] +" | "+ YELLOW +"| "+ f[66] + YELLOW +" | | "+ f[67] + YELLOW +" | "+ RESET +" ---------\n" + |
|
|
|
BLUE +"+---+ +---+"+ RESET +" +---+ "+ YELLOW +"+---+"+ RESET +" +---+ "+ YELLOW +"+---+ +---+\n" + RESET + |
|
|
|
" +---+ "+ YELLOW +" +---+ "+ RESET +" +---+\n" + |
|
|
|
" | "+ f[16] +" | "+ YELLOW +" | "+ f[49] + YELLOW +" | "+ RESET +" | "+ f[22] +" |\n" + |
|
|
@ -77,7 +78,68 @@ public class Gameboard { |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
Game g = new Game(); |
|
|
|
System.out.println(g.gb.printBoard(g, g.players.get(0))); |
|
|
|
System.out.println(g.gb.printBoard(g, g.players.get(0), 6)); |
|
|
|
} |
|
|
|
|
|
|
|
public String[] getDice (int dice) { |
|
|
|
String[] res = new String[7]; |
|
|
|
switch (dice) { |
|
|
|
case 1 -> { |
|
|
|
res[0] = " "; |
|
|
|
res[1] = " "; |
|
|
|
res[2] = " "; |
|
|
|
res[3] = "o"; |
|
|
|
res[4] = " "; |
|
|
|
res[5] = " "; |
|
|
|
res[6] = " "; |
|
|
|
} |
|
|
|
case 2 -> { |
|
|
|
res[0] = "o"; |
|
|
|
res[1] = " "; |
|
|
|
res[2] = " "; |
|
|
|
res[3] = " "; |
|
|
|
res[4] = " "; |
|
|
|
res[5] = " "; |
|
|
|
res[6] = "o"; |
|
|
|
} |
|
|
|
case 3 -> { |
|
|
|
res[0] = "o"; |
|
|
|
res[1] = " "; |
|
|
|
res[2] = " "; |
|
|
|
res[3] = "o"; |
|
|
|
res[4] = " "; |
|
|
|
res[5] = " "; |
|
|
|
res[6] = "o"; |
|
|
|
} |
|
|
|
case 4 -> { |
|
|
|
res[0] = "o"; |
|
|
|
res[1] = " "; |
|
|
|
res[2] = "o"; |
|
|
|
res[3] = " "; |
|
|
|
res[4] = "o"; |
|
|
|
res[5] = " "; |
|
|
|
res[6] = "o"; |
|
|
|
} |
|
|
|
case 5 -> { |
|
|
|
res[0] = "o"; |
|
|
|
res[1] = " "; |
|
|
|
res[2] = "o"; |
|
|
|
res[3] = "o"; |
|
|
|
res[4] = "o"; |
|
|
|
res[5] = " "; |
|
|
|
res[6] = "o"; |
|
|
|
} |
|
|
|
case 6 -> { |
|
|
|
res[0] = "o"; |
|
|
|
res[1] = "o"; |
|
|
|
res[2] = "o"; |
|
|
|
res[3] = " "; |
|
|
|
res[4] = "o"; |
|
|
|
res[5] = "o"; |
|
|
|
res[6] = "o"; |
|
|
|
} |
|
|
|
} |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
public String[] getFiguresOnBoard(Game g) { |
|
|
|