MCPcopy Create free account
hub / github.com/agateau/pixelwheels / flush

Method flush

core/src/com/agateau/pixelwheels/GameConfig.java:127–164  ·  view source on GitHub ↗
(ConfigGroup group)

Source from the content-addressed store, hash-verified

125 }
126
127 public void flush(ConfigGroup group) {
128 switch (group) {
129 case INPUT:
130 for (int idx = 0; idx < this.vehicles.length; ++idx) {
131 mPreferences.putString(
132 PrefConstants.INPUT_PREFIX + idx, mPlayerInputFactoryIds[idx]);
133 }
134 break;
135 case LANGUAGE:
136 mPreferences.putString(PrefConstants.LANGUAGE_ID, this.languageId);
137 break;
138 case OTHER:
139 mPreferences.putBoolean(PrefConstants.FULLSCREEN, fullscreen);
140 mPreferences.putBoolean(PrefConstants.HEADING_UP_CAMERA, headingUpCamera);
141 mPreferences.putBoolean(PrefConstants.SOUND_FX, playSoundFx);
142 mPreferences.putBoolean(PrefConstants.MUSIC, playMusic);
143
144 mPreferences.putString(PrefConstants.GAME_MODE, this.gameMode.toString());
145 mPreferences.putString(PrefConstants.DIFFICULTY, this.difficulty.toString());
146 for (int idx = 0; idx < this.vehicles.length; ++idx) {
147 mPreferences.putString(
148 PrefConstants.VEHICLE_ID_PREFIX + idx, this.vehicles[idx]);
149 }
150
151 mPreferences.putString(PrefConstants.TRACK_ID, this.track);
152 mPreferences.putString(PrefConstants.CHAMPIONSHIP_ID, this.championship);
153 mPreferences.putFloat(PrefConstants.HUD_ZOOM, this.hudZoom);
154 break;
155 }
156
157 mPreferences.flush();
158
159 mListeners.begin();
160 for (ChangeListener listener : mListeners) {
161 listener.onGameConfigChanged(group);
162 }
163 mListeners.end();
164 }
165
166 public GameInputHandler getPlayerInputHandler(int index) {
167 Assert.check(

Callers 11

changedMethod · 0.95
setChampionshipMethod · 0.45
setTrackMethod · 0.45
storePlayersInConfigMethod · 0.45
changedMethod · 0.45
saveSelectedMapMethod · 0.45
doSelectLanguageMethod · 0.45
triggeredMethod · 0.45
onInputChangedMethod · 0.45
exportLogsMethod · 0.45

Calls 7

putStringMethod · 0.80
putBooleanMethod · 0.80
putFloatMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
onGameConfigChangedMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected