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

Method setGame

code/src/java/pcgen/core/SettingsHandler.java:271–301  ·  view source on GitHub ↗
(final String key)

Source from the content-addressed store, hash-verified

269 }
270
271 public static void setGame(final String key)
272 {
273 final GameMode newMode = SystemCollections.getGameModeNamed(key);
274
275 if (newMode != null)
276 {
277 game.setValue(newMode);
278 }
279 // new key for game mode specific options are pcgen.options.gameMode.X.optionName
280 // but offer downward compatible support to read in old version for unitSet from 5.8.0
281 String unitSetName = getOptions().getProperty("pcgen.options.gameMode." + key + ".unitSetName",
282 getOptions().getProperty("pcgen.options.unitSetName." + key, game.get().getDefaultUnitSet()));
283 if (!game.get().selectUnitSet(unitSetName))
284 {
285 if (!game.get().selectDefaultUnitSet())
286 {
287 game.get().selectUnitSet(Constants.STANDARD_UNITSET_NAME);
288 }
289 }
290 game.get().setDefaultXPTableName(getPCGenOption(
291 "gameMode." + key + ".xpTableName", "")); //$NON-NLS-1$ //$NON-NLS-2$
292 game.get().setDefaultCharacterType(getPCGenOption(
293 "gameMode." + key + ".characterType", "")); //$NON-NLS-1$ //$NON-NLS-2$
294
295 AbilityCategory featTemplate = game.get().getFeatTemplate();
296 if (featTemplate != null)
297 {
298 AbilityCategory.FEAT.copyFields(featTemplate);
299 }
300 getChosenCampaignFiles(game.get());
301 }
302
303 public static ObjectProperty<GameMode> getGameAsProperty()
304 {

Callers 15

setUpMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
initGameModesMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
makeSizeAdjustmentsMethod · 0.95
setUpPCMethod · 0.95
setUpPCMethod · 0.95
performAnalysisMethod · 0.95

Calls 14

getGameModeNamedMethod · 0.95
getOptionsMethod · 0.95
getPCGenOptionMethod · 0.95
selectUnitSetMethod · 0.80
selectDefaultUnitSetMethod · 0.80
setDefaultXPTableNameMethod · 0.80
getFeatTemplateMethod · 0.80
copyFieldsMethod · 0.80
getMethod · 0.65
setValueMethod · 0.45

Tested by 13

setUpMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
initGameModesMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
makeSizeAdjustmentsMethod · 0.76
setUpPCMethod · 0.76
setUpPCMethod · 0.76
classSetUpMethod · 0.76