/**
* Retrieves all the needed information and print them into the box.
*/
private void printInfos() {
UnoGame game = ((Frame) parent).getGame();
UnoPlayer player = ((Frame) parent).getPlayer();
List<cero.games.Player> listPlayers = game.getPlayers().getSortedList();
title = new JLabel("", JLabel.CENTER);
for (cero.games.Player players : listPlayers) {
if (players.equals(player)) {
ZonesGroup zones = players.getZones();
int totalNumberOfCards = 0;
for (Zone zone : zones)
totalNumberOfCards += zone.getCardCount();
if (totalNumberOfCards == 0) {
title.setText("Tu as gagné");
SoundManager.playSound(new WaveSound("wav/gui/win.wav",
false));
} else {
title.setText("Tu as perdu");
SoundManager.playSound(new WaveSound("wav/gui/loose.wav",
false));
}
}
}
title.setFont(font);
title.setAlignmentX(JLabel.CENTER_ALIGNMENT);
labelPanel.add(title, BorderLayout.NORTH);
SoundManager.playSound(new TTSSound("",false));
String string = "\n";
for (cero.games.Player players : game.getPlayers()){
String substring = players.getPlayerName() + " : " + ((UnoPlayer) players).getPoints() + " points\n";
string += substring;
SoundManager.playSound(new TTSSound(substring + ".",false));
}