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(); }
@PostConstruct public void loadData() { games = gameService.findAllGames(); logger.info("Retreaving all games ..."); for (Game game : games) { logger.info("Game ..." + game.getName() + " date " + game.getStartTime()); } }
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; }
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(); }
public void settingUpPlayers(javax.faces.event.ActionEvent event) { int selectedRowIndex = gamesTable.getRowIndex(); actualGame = games.get(selectedRowIndex); logger.info("selected game " + actualGame.getName()); }