Add boolean 'isCustom' variable to GameInfoContainer and GameController
This commit is contained in:
parent
b12d085f27
commit
1c6be6e5c4
2 changed files with 11 additions and 0 deletions
|
@ -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());
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue