(ConfigGroup group)
| 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( |
no test coverage detected