Exemplo n.º 1
0
 @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);
   }
 }
Exemplo n.º 2
0
 @Override
 public String[] unparse(LoadContext context, PointBuyCost pbc) {
   return new String[] {String.valueOf(pbc.getBuyCost())};
 }