![JAR search and dependency download from the Maven repository](/logo.png)
net.sf.esfinge.gamification.processors.RankingsToUserProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gamification Show documentation
Show all versions of gamification Show documentation
The Esfinge Gamification is a matadata based framework applicable to systems requiring an gamification logic, regardless of the domain.
package net.sf.esfinge.gamification.processors;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import net.sf.esfinge.gamification.achievement.Ranking;
import net.sf.esfinge.gamification.annotation.RankingsToUser;
import net.sf.esfinge.gamification.mechanics.Game;
import net.sf.esfinge.gamification.user.UserStorage;
public class RankingsToUserProcessor implements AchievementProcessor {
private String name;
private String level;
@Override
public void receiveAnnotation(Annotation an) {
RankingsToUser rtu = (RankingsToUser) an;
name = rtu.name();
level = rtu.level();
}
@Override
public void process(Game game, Object encapsulated, Method method,
Object[] args) {
Object user = UserStorage.getUserID();
Ranking r = new Ranking(name, level);
game.addAchievement(user, r);
}
@Override
public void process(Game game, Object encapsulated,
Class extends Method> class1, Object[] args) {
Object user = UserStorage.getUserID();
Ranking r = new Ranking(name, level);
game.addAchievement(user, r);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy