@Subscribe public void checkDayChangeUpdates(ClockTickDayChange dayChange) { ICity town = city.getCity(); ICityHall cityHall = cityHallAccessor.getCityHall(town); final LocalDateTime electionDate = cityHall.getAldermanElectionDate(); if (dateService.isSameDay(electionDate, date.getCurrentDate())) { Platform.runLater(this::resetContent); } } @Subscribe
@Subscribe public void checkDayChangeUpdates(ClockTickDayChange dayChange) { ICity town = city.getCity(); IPlayer player = city.getPlayer(); ICityHall cityHall = cityHallAccessor.getCityHall(town); final LocalDateTime electionDate = cityHall.getElectionDate(); if (dateService.isSameDay(electionDate, date.getCurrentDate())) { Platform.runLater(() -> resetContent(town, player)); } } @Subscribe
@Subscribe public void checkPostDayChangeUpdates(ElectionWinnerNotification electionResult) { if (displayAtElectionDay && electionResult.getElectionType().equals(EElectionType.ALDERMAN) && electionResult.getCity().equals(city.getCity())) { ICity town = city.getCity(); ICityHall cityHall = cityHallAccessor.getCityHall(town); final LocalDateTime electionDate = cityHall.getAldermanElectionDate(); if (!dateService.isSameDay(electionDate, date.getCurrentDate())) { Platform.runLater(this::resetContent); } } } private StyleableObjectProperty<Font> font;
@Subscribe public void checkPostDayChangeUpdates(ElectionWinnerNotification electionResult) { if (displayAtElectionDay && electionResult.getElectionType().equals(EElectionType.MAYORAL) && electionResult.getCity().equals(city.getCity())) { ICity town = city.getCity(); IPlayer player = city.getPlayer(); ICityHall cityHall = cityHallAccessor.getCityHall(town); final LocalDateTime electionDate = cityHall.getElectionDate(); if (!dateService.isSameDay(electionDate, date.getCurrentDate())) { Platform.runLater(() -> resetContent(town, player)); } } }
public LocalDateTime cleanUpAuctionAndDetermineAuctionDate(LocalDateTime auctionDate, IGuild guild) { if (!guild.getAuctions().isEmpty()) { for (IAuction nextAuction : guild.getAuctions()) { if (dateService.isPast(nextAuction.getAuctionDate())) { nextAuction.setAuctionDate(date.getCurrentDate().plusDays(1)); } while (dateService.isSameDay(nextAuction.getAuctionDate(), auctionDate) ) { auctionDate = auctionDate.plusDays(1); } } } return auctionDate; } }
box.getChildren().add(text); final LocalDateTime electionDate = cityHall.getElectionDate(); if (dateService.isSameDay(electionDate, date.getCurrentDate())) { template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.cityhall.TownInfoNotice.electionDay", new Object[]{}, locale.getCurrentLocal()); displayAtElectionDay = true;
if (dateService.isSameDay(electionDate, today)) { String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.cityhall.HanseaticInfoDialog.electionDay", new Object[]{modelTranslator.toDisplayString(electionDate), alderman.getHometown().getName()}, locale.getCurrentLocal()); text = textFactory.createDecoratedText(template, new HashMap<>());