use of pcgen.util.enumeration.Visibility in project pcgen by PCGen.
the class VisibleToken method unparse.
@Override
public String[] unparse(LoadContext context, Equipment eq) {
Visibility vis = context.getObjectContext().getObject(eq, ObjectKey.VISIBILITY);
if (vis == null) {
return null;
}
String visString;
if (vis.equals(Visibility.DEFAULT)) {
visString = "YES";
} else if (vis.equals(Visibility.DISPLAY_ONLY)) {
visString = "DISPLAY";
} else if (vis.equals(Visibility.OUTPUT_ONLY)) {
visString = "EXPORT";
} else if (vis.equals(Visibility.HIDDEN)) {
visString = "NO";
} else {
context.addWriteMessage("Visibility " + vis + " is not a valid Visibility for an Equipment");
return null;
}
return new String[] { visString };
}
use of pcgen.util.enumeration.Visibility in project pcgen by PCGen.
the class VisibleToken method unparse.
@Override
public String[] unparse(LoadContext context, EquipmentModifier eqm) {
Visibility vis = context.getObjectContext().getObject(eqm, ObjectKey.VISIBILITY);
if (vis == null) {
return null;
}
String visString;
if (vis.equals(Visibility.DEFAULT)) {
visString = "YES";
} else if (vis.equals(Visibility.QUALIFY)) {
visString = "QUALIFY";
} else if (vis.equals(Visibility.HIDDEN)) {
visString = "NO";
} else {
context.addWriteMessage("Visibility " + vis + " is not a valid Visibility for a EqMod");
return null;
}
return new String[] { visString };
}
use of pcgen.util.enumeration.Visibility in project pcgen by PCGen.
the class VisibleToken method unparse.
@Override
public String[] unparse(LoadContext context, PCClass pcc) {
Visibility vis = context.getObjectContext().getObject(pcc, ObjectKey.VISIBILITY);
if (vis == null) {
return null;
}
String visString;
if (vis.equals(Visibility.DEFAULT)) {
visString = "YES";
} else if (vis.equals(Visibility.HIDDEN)) {
visString = "NO";
} else {
context.addWriteMessage("Visibility " + vis + " is not a valid Visibility for a PCClass");
return null;
}
return new String[] { visString };
}
use of pcgen.util.enumeration.Visibility in project pcgen by PCGen.
the class VisibleToken method unparse.
@Override
public String[] unparse(LoadContext context, Kit kit) {
Visibility vis = kit.get(ObjectKey.VISIBILITY);
if (vis == null) {
return null;
}
String visString;
if (vis.equals(Visibility.DEFAULT)) {
visString = "YES";
} else if (vis.equals(Visibility.QUALIFY)) {
visString = "QUALIFY";
} else if (vis.equals(Visibility.HIDDEN)) {
visString = "NO";
} else {
context.addWriteMessage("Visibility " + vis + " is not a valid Visibility for a Kit");
return null;
}
return new String[] { visString };
}
use of pcgen.util.enumeration.Visibility in project pcgen by PCGen.
the class VisibleToken method parseNonEmptyToken.
@Override
protected ParseResult parseNonEmptyToken(LoadContext context, Kit kit, String value) {
Visibility vis;
if (value.equals("QUALIFY")) {
vis = Visibility.QUALIFY;
} else if (value.equals("NO")) {
vis = Visibility.HIDDEN;
} else if (value.equals("YES")) {
vis = Visibility.DEFAULT;
} else {
return new ParseResult.Fail("Can't understand Visibility: " + value, context);
}
kit.put(ObjectKey.VISIBILITY, vis);
return ParseResult.SUCCESS;
}
Aggregations