MCPcopy Create free account
hub / github.com/PCGen/pcgen / dataAdded

Method dataAdded

code/src/java/pcgen/cdom/facet/analysis/VisionFacet.java:75–96  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

getListModsMethod · 0.95
getListAssociationsMethod · 0.95
getCDOMObjectMethod · 0.65
getCharIDMethod · 0.65
getPrerequisiteListMethod · 0.65
getContainedObjectsMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected