Search in sources :

Example 16 with PrerequisiteOperator

use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.

the class PreRaceWriter method specialCase.

@Override
public boolean specialCase(Writer writer, Prerequisite prereq) throws IOException {
    PrerequisiteOperator po = getConsolidateMethod(kindHandled(), prereq, false);
    if (po == null) {
        return false;
    }
    if (!po.equals(prereq.getOperator())) {
        writer.write('!');
    }
    writer.write("PRE" + kindHandled().toUpperCase() + ':' + (prereq.isOverrideQualify() ? "Q:" : ""));
    writer.write(po.equals(PrerequisiteOperator.GTEQ) ? prereq.getOperand() : "1");
    for (Prerequisite p : prereq.getPrerequisites()) {
        writer.write(',');
        writer.write(p.getKey());
    }
    return true;
}
Also used : PrerequisiteOperator(pcgen.core.prereq.PrerequisiteOperator) Prerequisite(pcgen.core.prereq.Prerequisite)

Example 17 with PrerequisiteOperator

use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.

the class PreVisionWriter method specialCase.

@Override
public boolean specialCase(Writer writer, Prerequisite prereq) throws IOException {
    PrerequisiteOperator po = getConsolidateMethod(kindHandled(), prereq, true);
    if (po == null) {
        return false;
    }
    if (!po.equals(prereq.getOperator())) {
        writer.write('!');
    }
    writer.write("PRE" + kindHandled().toUpperCase() + ':' + (prereq.isOverrideQualify() ? "Q:" : ""));
    writer.write(po.equals(PrerequisiteOperator.GTEQ) ? prereq.getOperand() : "1");
    for (Prerequisite p : prereq.getPrerequisites()) {
        writer.write(',');
        writer.write(p.getKey());
        writer.write('=');
        writer.write(p.getOperand());
    }
    return true;
}
Also used : PrerequisiteOperator(pcgen.core.prereq.PrerequisiteOperator) Prerequisite(pcgen.core.prereq.Prerequisite)

Example 18 with PrerequisiteOperator

use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.

the class PreWeaponProfWriter method specialCase.

@Override
public boolean specialCase(Writer writer, Prerequisite prereq) throws IOException {
    PrerequisiteOperator po = getConsolidateMethod(kindHandled(), prereq, false);
    if (po == null) {
        return false;
    }
    if (!po.equals(prereq.getOperator())) {
        writer.write('!');
    }
    writer.write("PRE" + kindHandled().toUpperCase() + ':' + (prereq.isOverrideQualify() ? "Q:" : ""));
    writer.write(po.equals(PrerequisiteOperator.GTEQ) ? prereq.getOperand() : "1");
    for (Prerequisite p : prereq.getPrerequisites()) {
        writer.write(',');
        writer.write(p.getKey());
    }
    return true;
}
Also used : PrerequisiteOperator(pcgen.core.prereq.PrerequisiteOperator) Prerequisite(pcgen.core.prereq.Prerequisite)

Example 19 with PrerequisiteOperator

use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.

the class PreEquipBothWriter method specialCase.

@Override
public boolean specialCase(Writer writer, Prerequisite prereq) throws IOException {
    PrerequisiteOperator po = getConsolidateMethod(kindHandled(), prereq, false);
    if (po == null) {
        return false;
    }
    if (!po.equals(prereq.getOperator())) {
        writer.write('!');
    }
    writer.write("PRE" + kindHandled().toUpperCase() + ':' + (prereq.isOverrideQualify() ? "Q:" : ""));
    writer.write(po.equals(PrerequisiteOperator.GTEQ) ? prereq.getOperand() : "1");
    for (Prerequisite p : prereq.getPrerequisites()) {
        writer.write(',');
        writer.write(p.getKey());
    }
    return true;
}
Also used : PrerequisiteOperator(pcgen.core.prereq.PrerequisiteOperator) Prerequisite(pcgen.core.prereq.Prerequisite)

Example 20 with PrerequisiteOperator

use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.

the class PreEquipPrimaryWriter method specialCase.

@Override
public boolean specialCase(Writer writer, Prerequisite prereq) throws IOException {
    PrerequisiteOperator po = getConsolidateMethod(kindHandled(), prereq, false);
    if (po == null) {
        return false;
    }
    if (!po.equals(prereq.getOperator())) {
        writer.write('!');
    }
    writer.write("PRE" + kindHandled().toUpperCase() + ':' + (prereq.isOverrideQualify() ? "Q:" : ""));
    writer.write(po.equals(PrerequisiteOperator.GTEQ) ? prereq.getOperand() : "1");
    for (Prerequisite p : prereq.getPrerequisites()) {
        writer.write(',');
        writer.write(p.getKey());
    }
    return true;
}
Also used : PrerequisiteOperator(pcgen.core.prereq.PrerequisiteOperator) Prerequisite(pcgen.core.prereq.Prerequisite)

Aggregations

PrerequisiteOperator (pcgen.core.prereq.PrerequisiteOperator)52 Prerequisite (pcgen.core.prereq.Prerequisite)50 PersistenceLayerException (pcgen.persistence.PersistenceLayerException)2 IOException (java.io.IOException)1