コード例 #1
0
 private void verifyCharms() {
   if (!context.isFullyLoaded()) {
     return;
   }
   List<ICharm> charmsToUnlearn = new ArrayList<ICharm>();
   for (ICharm charm : this.getLearnedCharms(true)) {
     boolean prerequisitesForCharmAreNoLongerMet = !isLearnable(charm);
     boolean charmCanBeUnlearned = isUnlearnable(charm);
     if (prerequisitesForCharmAreNoLongerMet && charmCanBeUnlearned) {
       charmsToUnlearn.add(charm);
     }
   }
   for (ICharm charm : charmsToUnlearn) {
     ILearningCharmGroup group = learningCharmGroupContainer.getLearningCharmGroup(charm);
     boolean learnedAtCreation = group.isLearned(charm, false);
     boolean learnedWithExperience = !learnedAtCreation;
     group.forgetCharm(charm, learnedWithExperience);
   }
 }
コード例 #2
0
 public final boolean isLearned(ICharm charm) {
   ILearningCharmGroup group = getGroup(charm);
   return group != null && group.isLearned(charm);
 }