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

Method doFormulaSetup

code/src/java/pcgen/core/PlayerCharacter.java:608–637  ·  view source on GitHub ↗
(LoadContext context)

Source from the content-addressed store, hash-verified

606 }
607
608 private void doFormulaSetup(LoadContext context)
609 {
610 VariableContext variableContext = context.getVariableContext();
611 FormulaManager formulaManager = variableContext.getPCFormulaManager();
612 MonitorableVariableStore varStore = new MonitorableVariableStore();
613 scopeFacet.set(id, formulaManager.getScopeInstanceFactory());
614 variableStoreFacet.set(id, varStore);
615 solverManagerFacet.set(id, variableContext.generateSolverManager(varStore));
616 ChannelUtilities.watchChannel(this, CControl.AGEINPUT, ageSetFacet);
617 ChannelUtilities.watchChannel(this, CControl.AGEINPUT, FacetLibrary.getFacet(AgeSetKitFacet.class));
618 ChannelUtilities.addListenerToChannel(this, CControl.AGEINPUT, x -> {
619 setDirty(true);
620 calcActiveBonuses();
621 });
622 if (isFeatureEnabled(CControl.ALIGNMENTFEATURE))
623 {
624 ChannelUtilities.setDirtyOnChannelChange(this, CControl.ALIGNMENTINPUT);
625 }
626 ChannelUtilities.setDirtyOnChannelChange(this, CControl.CHARACTERTYPE);
627 if (isFeatureEnabled(CControl.DOMAINFEATURE))
628 {
629 deityWatchSetup(context);
630 }
631 ChannelUtilities.setDirtyOnChannelChange(this, CControl.GOLDINPUT);
632 ChannelUtilities.setDirtyOnChannelChange(this, CControl.HAIRSTYLEINPUT);
633 ChannelUtilities.setDirtyOnChannelChange(this, CControl.HAIRCOLORINPUT);
634 ChannelUtilities.setDirtyOnChannelChange(this, CControl.HANDEDINPUT);
635 ChannelUtilities.setDirtyOnChannelChange(this, CControl.HEIGHTINPUT);
636 ChannelUtilities.setDirtyOnChannelChange(this, CControl.SKINCOLORINPUT);
637 }
638
639 private void deityWatchSetup(LoadContext context)
640 {

Callers 1

PlayerCharacterMethod · 0.95

Calls 12

getPCFormulaManagerMethod · 0.95
generateSolverManagerMethod · 0.95
watchChannelMethod · 0.95
getFacetMethod · 0.95
addListenerToChannelMethod · 0.95
setDirtyMethod · 0.95
calcActiveBonusesMethod · 0.95
isFeatureEnabledMethod · 0.95
deityWatchSetupMethod · 0.95
getVariableContextMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected