Search in sources :

Example 1 with NamedFormula

use of pcgen.base.util.NamedFormula in project pcgen by PCGen.

the class KitGear method processLookups.

private void processLookups(Kit aKit, PlayerCharacter aPC) {
    Collection<NamedFormula> lookups = getLookups();
    if (lookups == null) {
        return;
    }
    for (NamedFormula lookup : lookups) {
        KitTable kt = aKit.getTable(lookup.getName());
        KitGear gear = kt.getEntry(aPC, lookup.getFormula().resolve(aPC, "").intValue());
        gear.processLookups(aKit, aPC);
        overlayGear(gear);
    }
}
Also used : NamedFormula(pcgen.base.util.NamedFormula)

Example 2 with NamedFormula

use of pcgen.base.util.NamedFormula in project pcgen by PCGen.

the class LookupToken method unparse.

@Override
public String[] unparse(LoadContext context, KitGear kitGear) {
    Collection<NamedFormula> lookups = kitGear.getLookups();
    if (lookups == null) {
        return null;
    }
    List<String> list = new ArrayList<>();
    for (NamedFormula nf : lookups) {
        list.add(nf.getName() + ',' + nf.getFormula().toString());
    }
    return list.toArray(new String[list.size()]);
}
Also used : NamedFormula(pcgen.base.util.NamedFormula) ArrayList(java.util.ArrayList)

Aggregations

NamedFormula (pcgen.base.util.NamedFormula)2 ArrayList (java.util.ArrayList)1