コード例 #1
0
  @Override
  public ObservableList<PlayerAchievement> getPlayerAchievements(String username) {
    if (userService.getUsername().equals(username)) {
      if (readOnlyPlayerAchievements.isEmpty()) {
        updatePlayerAchievementsFromServer();
      }
      return readOnlyPlayerAchievements;
    }

    int playerId = playerService.getPlayerForUsername(username).getId();
    return FXCollections.observableList(fafApiAccessor.getPlayerAchievements(playerId));
  }
コード例 #2
0
 private void updatePlayerAchievementsFromServer() {
   playerAchievements.setAll(fafApiAccessor.getPlayerAchievements(userService.getUid()));
 }
コード例 #3
0
 @Override
 public CompletableFuture<AchievementDefinition> getAchievementDefinition(String achievementId) {
   return CompletableFuture.completedFuture(
       fafApiAccessor.getAchievementDefinition(achievementId));
 }
コード例 #4
0
 @Override
 public CompletableFuture<List<AchievementDefinition>> getAchievementDefinitions() {
   // TODO make async again
   return CompletableFuture.completedFuture(fafApiAccessor.getAchievementDefinitions());
 }