Example #1
0
 @Override
 public void onGameOver() {
   if (launcherInterface == null) { // Si la simulation a été lancée depuis la ligne de commande
     String finalTeams = "";
     for (InGameTeam team : game.getPlayerTeams()) {
       finalTeams += team.getName() + ", ";
     }
     finalTeams = finalTeams.substring(0, finalTeams.length() - 2);
     if (game.getPlayerTeams().size() == 1) {
       logger.log(Level.INFO, "Victoire de : " + finalTeams);
     } else {
       logger.log(Level.INFO, "Ex-Aequo entre les équipes : " + finalTeams);
     }
     game.setGameStopped();
   }
 }
Example #2
0
 @Override
 public void onGameStopped() {
   gdxFrame.setExtendedState(JFrame.ICONIFIED);
   //    	gdxFrame.setVisible(false);
   for (int i = 0; i < game.getAllTeams().size(); ++i) {
     game.getAllTeams().get(i).removeAllAgents();
   }
   game.getPlayerTeams().clear();
   settings.prepareForNewGame();
   logger.log(Level.INFO, "Reset settings");
   launcherInterface.setVisible(true);
   launcherInterface.revalidate();
   launcherInterface.repaint();
 }