コード例 #1
0
  public List<Ability> getClanLevelEffectsList(final MOB mob, final Integer level) {
    if (clanEffectNames == null) return empty;

    if ((clanEffectMap == null)
        && (clanEffectNames != null)
        && (clanEffectLevels != null)
        && (clanEffectParms != null)) clanEffectMap = new Hashtable<Integer, List<Ability>>();

    if (clanEffectMap == null) return empty;

    if (clanEffectMap.containsKey(level)) return clanEffectMap.get(level);
    final CMObjUniqSortSVec<Ability> finalV = new CMObjUniqSortSVec<Ability>();
    for (int v = 0; v < clanEffectLevels.length; v++) {
      if ((clanEffectLevels[v] <= level.intValue())
          && (clanEffectNames.length > v)
          && (clanEffectParms.length > v)) {
        Ability A = CMClass.getAbility(clanEffectNames[v]);
        if (A != null) {
          // mob was set to null here to make the cache map actually relevant .. see caching below
          A.setProficiency(CMLib.ableMapper().getMaxProficiency((MOB) null, true, A.ID()));
          A.setMiscText(clanEffectParms[v]);
          A.makeNonUninvokable();
          A.setSavable(false); // must go AFTER the ablve
          finalV.add(A);
        }
      }
    }
    finalV.trimToSize();
    clanEffectMap.put(level, finalV);
    return finalV;
  }
コード例 #2
0
 public List<Ability> getClanLevelAbilities(Integer level) {
   if ((clanAbilityMap == null)
       && (clanAbilityNames != null)
       && (clanAbilityLevels != null)
       && (clanAbilityProficiencies != null)
       && (clanAbilityQuals != null)) {
     CMLib.ableMapper().delCharMappings(ID()); // necessary for a "clean start"
     clanAbilityMap = new Hashtable<Integer, List<Ability>>();
     for (int i = 0; i < clanAbilityNames.length; i++) {
       CMLib.ableMapper()
           .addDynaAbilityMapping(
               ID(),
               clanAbilityLevels[i],
               clanAbilityNames[i],
               clanAbilityProficiencies[i],
               "",
               !clanAbilityQuals[i],
               false);
     }
   }
   if (clanAbilityMap == null) return empty;
   if (clanAbilityMap.containsKey(level)) return clanAbilityMap.get(level);
   List<AbilityMapper.AbilityMapping> V =
       CMLib.ableMapper().getUpToLevelListings(ID(), level.intValue(), true, true);
   CMObjUniqSortSVec<Ability> finalV = new CMObjUniqSortSVec<Ability>();
   for (AbilityMapper.AbilityMapping able : V) {
     Ability A = CMClass.getAbility(able.abilityID);
     if (A != null) {
       A.setProficiency(CMLib.ableMapper().getDefaultProficiency(ID(), false, A.ID()));
       A.setSavable(false);
       A.setMiscText(CMLib.ableMapper().getDefaultParm(ID(), false, A.ID()));
       finalV.add(A);
     }
   }
   finalV.trimToSize();
   clanAbilityMap.put(level, finalV);
   return finalV;
 }