Drives the necessary removal of the results of an ADDLEVEL: token to remove the added levels from a Player Character because the object granting the ADDLEVEL: was removed from the Player Character. Triggered when one of the Facets to which AddLevelFacet listens fires a DataFacetChangeEvent to indic
(DataFacetChangeEvent<CharID, PCTemplate> dfce)
| 90 | * change |
| 91 | */ |
| 92 | @Override |
| 93 | public void dataRemoved(DataFacetChangeEvent<CharID, PCTemplate> dfce) |
| 94 | { |
| 95 | PCTemplate template = dfce.getCDOMObject(); |
| 96 | CharID id = dfce.getCharID(); |
| 97 | PlayerCharacter pc = trackingFacet.getPC(id); |
| 98 | |
| 99 | List<LevelCommandFactory> lcfList = template.getSafeListFor(ListKey.ADD_LEVEL); |
| 100 | for (ListIterator<LevelCommandFactory> it = lcfList.listIterator(lcfList.size()); it.hasPrevious();) |
| 101 | { |
| 102 | LevelCommandFactory lcf = it.previous(); |
| 103 | remove(lcf.getLevelCount(), lcf.getPCClass(), pc); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Adds levels of the given PCClass to the given PlayerCharacter. |
nothing calls this directly
no test coverage detected