コード例 #1
0
ファイル: Aspect.java プロジェクト: jkat718/pcgen
 public static Aspect lastPassingAspect(List<Aspect> aspects, PlayerCharacter pc, Ability a) {
   Aspect retAspect = null;
   if (aspects != null) {
     for (int i = 0; i < aspects.size(); i++) {
       Aspect testAspect = aspects.get(i);
       if (testAspect.qualifies(pc, a)) {
         retAspect = testAspect;
       }
     }
   }
   return retAspect;
 }
コード例 #2
0
ファイル: Aspect.java プロジェクト: jkat718/pcgen
 public static String printAspect(
     PlayerCharacter pc, AspectName key, List<CNAbility> abilities, boolean printName) {
   if (abilities.size() == 0) {
     return "";
   }
   Ability sampleAbilityObject = abilities.get(0).getAbility();
   StringBuilder buff = new StringBuilder();
   List<Aspect> aspects = sampleAbilityObject.get(MapKey.ASPECT, key);
   Aspect aspect = lastPassingAspect(aspects, pc, sampleAbilityObject);
   if (aspect != null) {
     if (printName) {
       buff.append(aspect.getName()).append(": ");
     }
     buff.append(aspect.getAspectText(pc, abilities));
   }
   return buff.toString();
 }