Adds any granted Vision objects to this facet when a CDOMObject that grants Vision objects is added to a Player Character. Triggered when one of the Facets to which VisionFacet listens fires a DataFacetChangeEvent to indicate a CDOMObject was added to a Player Character. @param dfce The
(DataFacetChangeEvent<CharID, CDOMObject> dfce)
| 73 | * change |
| 74 | */ |
| 75 | @Override |
| 76 | public void dataAdded(DataFacetChangeEvent<CharID, CDOMObject> dfce) |
| 77 | { |
| 78 | CDOMObject cdo = dfce.getCDOMObject(); |
| 79 | Collection<CDOMReference<Vision>> mods = cdo.getListMods(Vision.VISIONLIST); |
| 80 | if (mods != null) |
| 81 | { |
| 82 | CharID id = dfce.getCharID(); |
| 83 | for (CDOMReference<Vision> ref : mods) |
| 84 | { |
| 85 | Collection<AssociatedPrereqObject> assoc = cdo.getListAssociations(Vision.VISIONLIST, ref); |
| 86 | for (AssociatedPrereqObject apo : assoc) |
| 87 | { |
| 88 | List<Prerequisite> prereqs = apo.getPrerequisiteList(); |
| 89 | for (Vision v : ref.getContainedObjects()) |
| 90 | { |
| 91 | add(id, new QualifiedObject<>(v, prereqs), cdo); |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Removes any granted Vision objects to this facet when a CDOMObject that |
nothing calls this directly
no test coverage detected