(LoadContext context, Spell spell)
| 69 | } |
| 70 | |
| 71 | @Override |
| 72 | public String[] unparse(LoadContext context, Spell spell) |
| 73 | { |
| 74 | BigDecimal i = context.getObjectContext().getObject(spell, ObjectKey.COST); |
| 75 | boolean globalClear = context.getObjectContext().wasRemoved(spell, ObjectKey.COST); |
| 76 | List<String> list = new ArrayList<>(); |
| 77 | if (globalClear) |
| 78 | { |
| 79 | list.add(Constants.LST_DOT_CLEAR); |
| 80 | } |
| 81 | if (i != null) |
| 82 | { |
| 83 | if (i.compareTo(BigDecimal.ZERO) <= 00) |
| 84 | { |
| 85 | context.addWriteMessage(getTokenName() + " requires a positive Integer"); |
| 86 | return null; |
| 87 | } |
| 88 | list.add(i.toString()); |
| 89 | } |
| 90 | if (list.isEmpty()) |
| 91 | { |
| 92 | return null; |
| 93 | } |
| 94 | return list.toArray(new String[0]); |
| 95 | } |
| 96 | |
| 97 | @Override |
| 98 | public Class<Spell> getTokenClass() |
nothing calls this directly
no test coverage detected