(LoadContext context, PCClass pcc, String value)
| 37 | } |
| 38 | |
| 39 | @Override |
| 40 | public ParseResult parseToken(LoadContext context, PCClass pcc, String value) |
| 41 | { |
| 42 | try |
| 43 | { |
| 44 | int in = Integer.parseInt(value); |
| 45 | if (in <= 0) |
| 46 | { |
| 47 | return new ParseResult.Fail(getTokenName() + " must be an integer > 0"); |
| 48 | } |
| 49 | context.getObjectContext().put(pcc, ObjectKey.LEVEL_HITDIE, new HitDie(in)); |
| 50 | return ParseResult.SUCCESS; |
| 51 | } |
| 52 | catch (NumberFormatException nfe) |
| 53 | { |
| 54 | return new ParseResult.Fail( |
| 55 | getTokenName() + " expected an integer. Tag must be of the form: " + getTokenName() + ":<int>"); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public String[] unparse(LoadContext context, PCClass pcc) |
nothing calls this directly
no test coverage detected