diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java index 1a0fbbc..88e2472 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java @@ -64,6 +64,7 @@ public class GameController implements IModelChangedListener, Parcelable { private GameType gameType; private GameDifficulty difficulty; private CellConflictList errorList = new CellConflictList(); + private boolean gameIsCustom; // Undo Redo private UndoRedoManager undoRedoManager; @@ -91,6 +92,7 @@ public class GameController implements IModelChangedListener, Parcelable { public GameController(GameType type, SharedPreferences pref, Context context) { this.context = context; this.gameBoard = new GameBoard(type); + this.gameIsCustom = false; setGameType(type); setSettings(pref); @@ -102,6 +104,8 @@ public class GameController implements IModelChangedListener, Parcelable { return gameID; } + public boolean gameIsCustom() { return gameIsCustom; } + public void loadNewLevel(GameType type, GameDifficulty difficulty) { NewLevelManager newLevelManager = NewLevelManager.getInstance(context, settings); @@ -141,6 +145,7 @@ public class GameController implements IModelChangedListener, Parcelable { this.difficulty = gic.getDifficulty(); this.time = gic.getTimePlayed(); this.usedHints = gic.getHintsUsed(); + this.gameIsCustom = gic.isCustom(); setGameType(gic.getGameType()); this.gameBoard = new GameBoard(gic.getGameType()); diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java index 9365a39..a2d6ade 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java @@ -25,6 +25,7 @@ public class GameInfoContainer { int[] setValues; boolean[][] setNotes; int hintsUsed; + boolean isCustom; public GameInfoContainer() {} public GameInfoContainer(int ID, GameDifficulty difficulty, GameType gameType, int[] fixedValues, int[] setValues, boolean[][] setNotes) { @@ -40,12 +41,17 @@ public class GameInfoContainer { this.setValues = setValues; this.setNotes = setNotes; this.hintsUsed = hintsUsed; + isCustom = false; } public void setID(int ID) { this.ID = ID; } + public void setCustom (boolean isCustom) { this.isCustom = isCustom; } + + public boolean isCustom () { return isCustom; } + public void parseGameType(String s) { gameType = Enum.valueOf(GameType.class, s); if(gameType == null) {