Code example for Achievement

Methods: getAchievementIdgetCurrentStepsgetStategetTotalStepsgetType

2
	private int state;
	private int type;
	private int goal;
 
	public AchievementVO(Achievement baseAchievement) {
		setAchievementId(baseAchievement.getAchievementId());
 
		int baseState = baseAchievement.getState();
		switch (baseState) {
		case Achievement.STATE_HIDDEN:
			setState(AchievementVO.STATE_HIDDEN);
			break; 
		case Achievement.STATE_REVEALED:
			setState(AchievementVO.STATE_REVEALED);
			break; 
		case Achievement.STATE_UNLOCKED:
			setState(AchievementVO.STATE_UNLOCKED);
			break; 
		} 
 
		int baseType = baseAchievement.getType();
		switch (baseType) {
		case Achievement.TYPE_INCREMENTAL:
			type = AchievementVO.TYPE_INCREMENTAL;
			setCurrentSteps(baseAchievement.getCurrentSteps());
			setGoal(baseAchievement.getTotalSteps());
			break; 
		case Achievement.TYPE_STANDARD:
			type = AchievementVO.TYPE_STANDARD;
			setCurrentSteps(getState() == AchievementVO.STATE_UNLOCKED ? 1 : 0);
			setGoal(1); 
Stop searching for code, let great code find you!  Add Codota to your java IDE