public void buildInfoPlayers() throws RealPlayerException {
// panel for the Real Player
PanelInfoRealPlayer panelRealPlayer = this.panelInfoRealPlayer;
// panel for the IA Players
PanelInfoIAPlayers panelIAPlayers = this.panelInfoIAPlayers;
// we loop on each player
for(final Player p: Game.getInstance().getPlayerManager().getPlayers()) {
// if it is the RealPlayer, we fill the panelRealPlayer
if(p instanceof RealPlayer) {
panelRealPlayer.buildPanel(width, height, (RealPlayer)p);
}
// else if it is an IA JPlayer we fill the panelIAPlayers with a new JPanel for each IAPlayer
else {
panelIAPlayers.buildPanel(width, height, p);
}
}
// finally we add the two panels (panelRealPlayer and panelIAPlayers) to the window
content.add(panelRealPlayer);