(LoadContext context, CDOMObject cdo)
| 123 | } |
| 124 | |
| 125 | @Override |
| 126 | public String[] unparse(LoadContext context, CDOMObject cdo) |
| 127 | { |
| 128 | ChooseInformation<?> tc = context.getObjectContext().getObject(cdo, ObjectKey.CHOOSE_INFO); |
| 129 | if (tc == null) |
| 130 | { |
| 131 | return null; |
| 132 | } |
| 133 | if (!tc.getName().equals(getTokenName())) |
| 134 | { |
| 135 | // Don't unparse anything that isn't owned by this SecondaryToken |
| 136 | /* |
| 137 | * TODO Either this really needs to be a check against the subtoken |
| 138 | * (which thus needs to be stored in the ChooseInfo) or there needs |
| 139 | * to be a loadtime check that no more than once CHOOSE subtoken |
| 140 | * uses the same AssociationListKey... :P |
| 141 | */ |
| 142 | return null; |
| 143 | } |
| 144 | if (!tc.getGroupingState().isValid()) |
| 145 | { |
| 146 | context.addWriteMessage("Invalid combination of objects" + " was used in: " + getParentToken() |
| 147 | + Constants.COLON + getTokenName()); |
| 148 | return null; |
| 149 | } |
| 150 | StringBuilder sb = new StringBuilder(); |
| 151 | sb.append(((CategorizedChooseInformation<?>) tc).getCategory().getLSTformat(false)); |
| 152 | sb.append('|'); |
| 153 | sb.append(tc.getLSTformat()); |
| 154 | String title = tc.getTitle(); |
| 155 | if (!title.equals(getDefaultTitle())) |
| 156 | { |
| 157 | sb.append("|TITLE="); |
| 158 | sb.append(title); |
| 159 | } |
| 160 | return new String[]{sb.toString()}; |
| 161 | } |
| 162 | |
| 163 | @Override |
| 164 | public void applyChoice(ChooseDriver owner, Ability st, PlayerCharacter pc) |
nothing calls this directly
no test coverage detected