use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.
the class PrePointBuyMethodWriter method specialCase.
/**
* @see pcgen.persistence.lst.output.prereq.AbstractPrerequisiteWriter#specialCase(java.io.Writer writer, pcgen.core.prereq.Prerequisite prereq)
*/
@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 PreSkillSitWriter method specialCase.
@Override
public boolean specialCase(Writer writer, Prerequisite prereq) throws IOException {
PrerequisiteOperator po = getConsolidateMethod(kindHandled(), prereq, true);
if (po == null) {
return false;
}
String skill = null;
boolean foundSkill = false;
for (Prerequisite p : prereq.getPrerequisites()) {
if (foundSkill) {
String thisskill = p.getCategoryName();
if (thisskill == null) {
if (skill != null) {
return false;
}
} else {
if (!thisskill.equals(skill)) {
return false;
}
}
} else {
skill = p.getCategoryName();
foundSkill = true;
}
}
if (!po.equals(prereq.getOperator())) {
writer.write('!');
}
writer.write("PRESKILLSIT:");
writer.write(prereq.isOverrideQualify() ? "Q:" : "");
writer.write(po.equals(PrerequisiteOperator.GTEQ) ? prereq.getOperand() : "1");
writer.write(',');
writer.write("SKILL=");
writer.write(skill);
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 PreSpecialAbilityWriter 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 PreSpellDescriptorWriter 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;
}
use of pcgen.core.prereq.PrerequisiteOperator in project pcgen by PCGen.
the class PreRuleWriter 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;
}
Aggregations