use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.
the class PreSkillMultWriter 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());
if (p.getSubKey() != null) {
writer.write(" (");
writer.write(p.getSubKey());
writer.write(")");
}
writer.write('=');
writer.write(p.getOperand());
}
return true;
}
use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.
the class PreSpellCastWriter 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 == PrerequisiteOperator.GTEQ && !"1".equals(prereq.getOperand())) {
return false;
}
if (po != prereq.getOperator()) {
writer.write('!');
}
writer.write("PRESPELLCAST:" + (prereq.isOverrideQualify() ? "Q:" : ""));
boolean first = true;
for (Prerequisite p : prereq.getPrerequisites()) {
if (!first) {
writer.write(',');
}
writer.write("TYPE=" + p.getKey());
first = false;
}
return true;
}
use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.
the class PreSubClassWriter 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;
}
use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.
the class PreTemplateWriter 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;
}
use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.
the class PreSkillWriter 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());
if (p.getSubKey() != null) {
writer.write(" (");
writer.write(p.getSubKey());
writer.write(")");
}
writer.write('=');
writer.write(p.getOperand());
}
return true;
}
Aggregations