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

Method buildCoreDebugList

code/src/java/pcgen/gui2/facade/CoreUtils.java:51–151  ·  view source on GitHub ↗
(PlayerCharacter pc, CorePerspective pers)

Source from the content-addressed store, hash-verified

49 }
50
51 static <T> List<CoreViewNodeFacade> buildCoreDebugList(PlayerCharacter pc, CorePerspective pers)
52 {
53 CharID id = pc.getCharID();
54 List<CoreViewNodeFacade> coreViewList = new ArrayList<>();
55 Collection<Object> locations = CorePerspectiveDB.getLocations(pers);
56 MapToList<Object, FacetView<T>> sources = new HashMapToList<>();
57 Map<FacetView<T>, CoreViewNodeBase> facetToNode = new HashMap<>();
58
59 /*
60 * Create the nodes that are part of this perspective.
61 */
62 for (Object location : locations)
63 {
64 //Create (w/ identifier)
65 FacetView<T> view = CorePerspectiveDB.getView(pers, location);
66 CoreViewNodeBase node = new LocationCoreViewNode<>(location);
67 facetToNode.put(view, node);
68 coreViewList.add(node);
69 //Store what facets listen to my content (for use later)
70 for (Object listener : view.getChildren())
71 {
72 Object lView = CorePerspectiveDB.getViewOfFacet(listener);
73 Object src = (lView == null) ? listener : lView;
74 sources.addToListFor(src, view);
75 }
76 Collection<Object> parents = CorePerspectiveDB.getVirtualParents(view);
77 if (parents != null)
78 {
79 for (Object parent : parents)
80 {
81 FacetView<T> parentView = CorePerspectiveDB.getViewOfFacet(parent);
82 if (parentView == null)
83 {
84 Logging.errorPrint("Expected " + parent + " to be a registered Facet in Perspective " + pers);
85 }
86 sources.addToListFor(view, parentView);
87 }
88 }
89 }
90 for (Object location : locations)
91 {
92 FacetView<T> view = CorePerspectiveDB.getView(pers, location);
93 CoreViewNodeBase node = facetToNode.get(view);
94 /*
95 * Check the source of each child to identify if:
96 *
97 * (a) The source is a Loadable that can thus be identified as such
98 *
99 * (b) The source is a known facet (and thus is identified as such)
100 *
101 * (c) the source is not something recognized
102 */
103 for (T obj : view.getSet(id))
104 {
105 List<String> sourceDesc = new ArrayList<>();
106 for (Object src : view.getSources(id, obj))
107 {
108 if (src instanceof Identified)

Callers 1

getCoreViewTreeMethod · 0.95

Calls 15

getLocationsMethod · 0.95
getViewMethod · 0.95
getViewOfFacetMethod · 0.95
getVirtualParentsMethod · 0.95
errorPrintMethod · 0.95
getLoadIDMethod · 0.95
getPerspectiveOfFacetMethod · 0.95
getSimpleNameMethod · 0.80
addGrantedByNodeMethod · 0.80
getCharIDMethod · 0.65
putMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected