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

Method applyPreferences

code/src/java/pcgen/core/GameMode.java:192–209  ·  view source on GitHub ↗

Apply the stored preferences to the game mode.

()

Source from the content-addressed store, hash-verified

190 * Apply the stored preferences to the game mode.
191 */
192 public void applyPreferences()
193 {
194 gamemodePrefsContext = prefsContext.createChildContext(name);
195 String rollMethodExpr = gamemodePrefsContext.getProperty("rollMethodExpression"); //$NON-NLS-1$
196 if (StringUtils.isNotBlank(rollMethodExpr))
197 {
198 activeRollMethod = getModeContext().getReferenceContext().silentlyGetConstructedCDOMObject(RollMethod.class,
199 rollMethodExpr);
200 if (activeRollMethod == null)
201 {
202 Logging.errorPrint("Could not find roll method '" //$NON-NLS-1$
203 + rollMethodExpr + "' while loading game mode " + name); //$NON-NLS-1$
204 }
205 }
206 rollMethod = gamemodePrefsContext.getInt("rollMethod"); //$NON-NLS-1$
207 allStatsValue = gamemodePrefsContext.initInt("allStatsValue", 10); //$NON-NLS-1$
208 purchaseMethodName = gamemodePrefsContext.getProperty("purchaseMethodName"); //$NON-NLS-1$
209 }
210
211 /**
212 * Set the AC Text.

Callers 1

loadGameModeMiscInfoMethod · 0.95

Calls 8

getModeContextMethod · 0.95
errorPrintMethod · 0.95
getIntMethod · 0.80
initIntMethod · 0.80
getReferenceContextMethod · 0.65
createChildContextMethod · 0.45
getPropertyMethod · 0.45

Tested by

no test coverage detected