src/main/java/tsz/game/controller/AchievementsController.java
/**
	 * Checks whether the player earned the achievements or not.
	 */
Checks whether the player earned the achievements or not.
Checks whether the player earned the achievements or not .
@FXML
	public void checkTheAchievements() {
		String playername = this.main.getPlayer().getName();
		AchievementService service = new AchievementService();
		GameDataDAO gamedataDAO = new GameDataDAO();
		Collection<GameData> allGamedata = gamedataDAO.getAllGameData();		
		if(service.isInexpert(allGamedata, playername)) {
			inexpert.setFill(Color.DARKGREEN);
		} else {
			inexpert.setFill(Color.TRANSPARENT);
		}
		if(service.isSkillfulBeginner(allGamedata, playername)) {
			skillfulBeginner.setFill(Color.DARKGREEN);
		} else {
			skillfulBeginner.setFill(Color.TRANSPARENT);
		}
		if(service.isPatient(allGamedata, playername)) {
			patient.setFill(Color.DARKGREEN);
		} else {
			patient.setFill(Color.TRANSPARENT);
		}
		if(service.isProfessional(allGamedata, playername)) {
			professional.setFill(Color.DARKGREEN);
		} else {
			professional.setFill(Color.TRANSPARENT);
		}
		if(service.isChampionOnEasy(allGamedata, playername)) {
			championOnEasy.setFill(Color.DARKGREEN);
		} else {
			championOnEasy.setFill(Color.TRANSPARENT);
		}
		if(service.isChampionOnMedium(allGamedata, playername)) {
			championOnMedium.setFill(Color.DARKGREEN);
		} else {
			championOnMedium.setFill(Color.TRANSPARENT);
		}
		if(service.isChampionOnHard(allGamedata, playername)) {
			championOnHard.setFill(Color.DARKGREEN);
		} else {
			championOnHard.setFill(Color.TRANSPARENT);
		}
	}
@ FXML public void checkTheAchievements ( ) { String playername = this . main . getPlayer ( ) . getName ( ) ; AchievementService service = new AchievementService ( ) ; GameDataDAO gamedataDAO = new GameDataDAO ( ) ; Collection < GameData > allGamedata = gamedataDAO . getAllGameData ( ) ; if ( service . isInexpert ( allGamedata , playername ) ) { inexpert . setFill ( Color . DARKGREEN ) ; } else { inexpert . setFill ( Color . TRANSPARENT ) ; } if ( service . isSkillfulBeginner ( allGamedata , playername ) ) { skillfulBeginner . setFill ( Color . DARKGREEN ) ; } else { skillfulBeginner . setFill ( Color . TRANSPARENT ) ; } if ( service . isPatient ( allGamedata , playername ) ) { patient . setFill ( Color . DARKGREEN ) ; } else { patient . setFill ( Color . TRANSPARENT ) ; } if ( service . isProfessional ( allGamedata , playername ) ) { professional . setFill ( Color . DARKGREEN ) ; } else { professional . setFill ( Color . TRANSPARENT ) ; } if ( service . isChampionOnEasy ( allGamedata , playername ) ) { championOnEasy . setFill ( Color . DARKGREEN ) ; } else { championOnEasy . setFill ( Color . TRANSPARENT ) ; } if ( service . isChampionOnMedium ( allGamedata , playername ) ) { championOnMedium . setFill ( Color . DARKGREEN ) ; } else { championOnMedium . setFill ( Color . TRANSPARENT ) ; } if ( service . isChampionOnHard ( allGamedata , playername ) ) { championOnHard . setFill ( Color . DARKGREEN ) ; } else { championOnHard . setFill ( Color . TRANSPARENT ) ; } }
Checks whether the player earned the achievements or not.
Checks whether the player earned the achievements or not .