@Override protected ParseResult parseNonEmptyToken(LoadContext context, PointBuyCost pbc, String value) { try { pbc.setBuyCost(Integer.valueOf(value).intValue()); return ParseResult.SUCCESS; } catch (NumberFormatException nfe) { return new ParseResult.Fail( getTokenName() + " expected an integer. Tag must be of the form: " + getTokenName() + ":<int>", context); } }
@Override public String[] unparse(LoadContext context, PointBuyCost pbc) { return new String[] {String.valueOf(pbc.getBuyCost())}; }