public List<Achievement> getCompletedAchievements() { if (achievements.size() == 0) { return Collections.emptyList(); } List<Achievement> completed = new LinkedList<Achievement>(); for (Achievement achievement : achievements.values()) { if (achievement.isCompleted()) { completed.add(achievement); } } return completed; }
public void addArchievement(Achievement achievement) { if (achievement == null) { return; } System.out.println("Adding new Achievement: " + achievement); achievements.put(achievement.getName(), achievement); }