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

Method getModifier

code/src/java/pcgen/cdom/facet/ModifierFacet.java:73–90  ·  view source on GitHub ↗
(CharID id, ScopeInstance source, FormulaModifier<T> modifier,
		VarScoped thisValue)

Source from the content-addressed store, hash-verified

71 }
72
73 private <T> Modifier<T> getModifier(CharID id, ScopeInstance source, FormulaModifier<T> modifier,
74 VarScoped thisValue)
75 {
76 PCGenScope legalScope = (PCGenScope) source.getLegalScope();
77 LoadContext context = loadContextFacet.get(id.getDatasetID()).get();
78 Modifier<T> returnValue;
79 Optional<FormatManager<?>> formatManager = legalScope.getFormatManager(context);
80 if (formatManager.isPresent())
81 {
82 returnValue = new DefinedWrappingModifier<>(modifier, "this",
83 thisValue, formatManager.get());
84 }
85 else
86 {
87 returnValue = new ModifierDecoration<>(modifier);
88 }
89 return returnValue;
90 }
91
92 @Override
93 public void dataRemoved(DataFacetChangeEvent<CharID, PCGenScoped> dfce)

Callers 2

processAdditionMethod · 0.95
processRemovalMethod · 0.95

Calls 5

getFormatManagerMethod · 0.95
getDatasetIDMethod · 0.80
isPresentMethod · 0.80
getMethod · 0.65
getLegalScopeMethod · 0.45

Tested by

no test coverage detected