Drives the necessary results of an ADDLEVEL: token to apply the results to a Player Character. Triggered when one of the Facets to which AddLevelFacet listens fires a DataFacetChangeEvent to indicate a CDOMObject was added to a Player Character. @param dfce The DataFacetChangeEvent cont
(DataFacetChangeEvent<CharID, PCTemplate> dfce)
| 59 | * change |
| 60 | */ |
| 61 | @Override |
| 62 | public void dataAdded(DataFacetChangeEvent<CharID, PCTemplate> dfce) |
| 63 | { |
| 64 | PCTemplate template = dfce.getCDOMObject(); |
| 65 | CharID id = dfce.getCharID(); |
| 66 | PlayerCharacter pc = trackingFacet.getPC(id); |
| 67 | |
| 68 | // If we are importing these levels will have been saved with the |
| 69 | // character so don't apply them again. |
| 70 | if (!pc.isImporting()) |
| 71 | { |
| 72 | for (LevelCommandFactory lcf : template.getSafeListFor(ListKey.ADD_LEVEL)) |
| 73 | { |
| 74 | add(lcf.getLevelCount(), lcf.getPCClass(), pc); |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Drives the necessary removal of the results of an ADDLEVEL: token to |
nothing calls this directly
no test coverage detected