Allow eleven (instead of ten) sudokus to be saved by the GameStateManager if one of them is the daily sudoku
This commit is contained in:
parent
56db7277ca
commit
29933c01eb
1 changed files with 7 additions and 1 deletions
|
@ -20,6 +20,7 @@ public class GameStateManager {
|
||||||
|
|
||||||
Context context;
|
Context context;
|
||||||
private SharedPreferences settings;
|
private SharedPreferences settings;
|
||||||
|
private boolean includesDaily;
|
||||||
|
|
||||||
private static String FILE_EXTENSION = ".txt";
|
private static String FILE_EXTENSION = ".txt";
|
||||||
private static String SAVE_PREFIX = "save_";
|
private static String SAVE_PREFIX = "save_";
|
||||||
|
@ -87,6 +88,11 @@ public class GameStateManager {
|
||||||
gic.parseSetValues(values[i++]);
|
gic.parseSetValues(values[i++]);
|
||||||
gic.parseNotes(values[i++]);
|
gic.parseNotes(values[i++]);
|
||||||
gic.parseHintsUsed(values[i++]);
|
gic.parseHintsUsed(values[i++]);
|
||||||
|
|
||||||
|
if (gic.getID() == GameController.DAILY_SUDOKU_ID) {
|
||||||
|
includesDaily = true;
|
||||||
|
}
|
||||||
|
|
||||||
} catch(IllegalArgumentException e) {
|
} catch(IllegalArgumentException e) {
|
||||||
file.delete();
|
file.delete();
|
||||||
continue;
|
continue;
|
||||||
|
@ -108,7 +114,7 @@ public class GameStateManager {
|
||||||
LinkedList<GameInfoContainer> removeList = new LinkedList<>();
|
LinkedList<GameInfoContainer> removeList = new LinkedList<>();
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
if(i >= MAX_NUM_OF_SAVED_GAMES) {
|
if((i >= MAX_NUM_OF_SAVED_GAMES && !includesDaily) || i > MAX_NUM_OF_SAVED_GAMES) {
|
||||||
deleteGameStateFile(list.get(i));
|
deleteGameStateFile(list.get(i));
|
||||||
removeList.add(list.get(i));
|
removeList.add(list.get(i));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue