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

Method initGameModes

code/src/java/pcgen/system/FacadeFactory.java:124–159  ·  view source on GitHub ↗
(List<GameMode> modes)

Source from the content-addressed store, hash-verified

122 }
123
124 private static void initGameModes(List<GameMode> modes)
125 {
126 for (GameMode mode : modes)
127 {
128 String title = mode.getDefaultSourceTitle();
129 if (SettingsHandler.getGameAsProperty().get().equals(mode) && title == null && !mode.getDefaultDataSetList().isEmpty())
130 {
131 title = mode.getName();
132 }
133 if (title != null && !title.isEmpty())
134 {
135 DefaultListFacade<Campaign> qcamps = new DefaultListFacade<>();
136 List<String> sources = mode.getDefaultDataSetList();
137 for (String string : sources)
138 {
139 Campaign camp = Globals.getCampaignKeyed(string);
140 if (camp != null)
141 {
142 qcamps.addElement(camp);
143 }
144 else
145 {
146 Logging.log(Logging.WARNING, "Unable to find source " + string + " used in default source "
147 + title + " for game mode " + mode + ". " + title + " might not work correctly.");
148 }
149 }
150 if (qcamps.isEmpty())
151 {
152 Logging.log(Logging.WARNING,
153 "Unable to load default source '" + title + "'. All of its sources are missing.");
154 continue;
155 }
156 quickSources.addElement(new BasicSourceSelectionFacade(mode.getDefaultSourceTitle(), qcamps, mode));
157 }
158 }
159 }
160
161 private static void initDisplayedSources()
162 {

Callers 1

initializeMethod · 0.95

Calls 11

getGameAsPropertyMethod · 0.95
getCampaignKeyedMethod · 0.95
addElementMethod · 0.95
logMethod · 0.95
getDefaultSourceTitleMethod · 0.80
getDefaultDataSetListMethod · 0.80
equalsMethod · 0.65
getMethod · 0.65
isEmptyMethod · 0.65
getNameMethod · 0.65
addElementMethod · 0.65

Tested by

no test coverage detected