Esempio n. 1
0
  public void saveGame(javax.faces.event.ActionEvent event) {
    editingGame = false;
    long result = 0;

    result = getMilsec(durationUnit, duration);

    actualGame.setDuration(result);

    result = getMilsec(thresholdEventsUnit, lowerThreshold);

    actualGame.setLowerThreshold(result);

    result = getMilsec(thresholdEventsUnit, upperThreshold);

    actualGame.setUpperThreshold(result);

    result = getMilsec(productionTimeUnit, productionTime);

    actualGame.setProductionTime(result);

    gameService.save(actualGame);
    actualGame = new Game();
    games = gameService.findAllGames();

    clearTemporalValues();
  }
Esempio n. 2
0
 @PostConstruct
 public void loadData() {
   games = gameService.findAllGames();
   logger.info("Retreaving all games ...");
   for (Game game : games) {
     logger.info("Game ..." + game.getName() + "  date " + game.getStartTime());
   }
 }
Esempio n. 3
0
  private void transformToActualUnits() {
    durationUnitDivider = calculateUnitDivider(durationUnit);
    productionUnitDivider = calculateUnitDivider(productionTimeUnit);
    upperThresholdUnitDivider =
        lowerThresholdUnitDivider = calculateUnitDivider(thresholdEventsUnit);

    duration = actualGame.getDuration() / durationUnitDivider;
    lowerThreshold = actualGame.getLowerThreshold() / productionUnitDivider;
    upperThreshold = actualGame.getUpperThreshold() / upperThresholdUnitDivider;
    productionTime = actualGame.getProductionTime() / upperThresholdUnitDivider;
  }
Esempio n. 4
0
  public void settingUpGame(javax.faces.event.ActionEvent event) {
    settingGame = true;
    int selectedRowIndex = gamesTable.getRowIndex();
    actualGame = games.get(selectedRowIndex);
    logger.info("selected game " + actualGame.getName());

    transformToActualUnits();
  }
Esempio n. 5
0
 public void settingUpPlayers(javax.faces.event.ActionEvent event) {
   int selectedRowIndex = gamesTable.getRowIndex();
   actualGame = games.get(selectedRowIndex);
   logger.info("selected game " + actualGame.getName());
 }