Exemplo n.º 1
0
 public static final void evaluate(final PlayerContext pc) {
   if (pc == null) {
     return;
   }
   final Profile profile = pc.profile;
   final Set<Integer> achieved = profile.achievements;
   final int size = ALL.length;
   boolean any = false;
   for (int i = 0; i < size; i++) {
     final Integer key = Integer.valueOf(i);
     if (achieved.contains(key)) {
       continue;
     }
     final Achievement ach = ALL[i];
     if (ach.isMet(pc)) {
       achieved.add(key);
       final int award = ach.award;
       FurGuardiansGame.notify(
           pc, ach.getName() + ", " + award + " Gem bonus", new Gem(FurGuardiansGame.gemAchieve));
       pc.addGems(award);
       any = true;
     }
   }
   if (any) {
     profile.save();
   }
 }
Exemplo n.º 2
0
 @Override
 public final long getCurrent(final Profile prf) {
   return prf.getRank();
 }