mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +00:00
started a basis for the tutorials, tic tac toe is almost done with some general stuff still to do.
This commit is contained in:
@@ -14,7 +14,7 @@ public class JsonAsset<T> extends BaseResource implements LoadableResource {
|
||||
|
||||
private T content;
|
||||
private Class<T> type;
|
||||
private final Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
private final Gson gson = new GsonBuilder().serializeNulls().setPrettyPrinting().create();
|
||||
|
||||
public JsonAsset(File file, Class<T> type) {
|
||||
super(file);
|
||||
|
||||
@@ -38,6 +38,22 @@ public class SettingsAsset extends JsonAsset<Settings> {
|
||||
return getContent().layoutSize;
|
||||
}
|
||||
|
||||
public Boolean getTutorialFlag() {
|
||||
return getContent().showTutorials;
|
||||
}
|
||||
|
||||
public Boolean getFirstTTT() {
|
||||
return getContent().firstTTT;
|
||||
}
|
||||
|
||||
public Boolean getFirstConnect4() {
|
||||
return getContent().firstConnect4;
|
||||
}
|
||||
|
||||
public Boolean getFirstReversi() {
|
||||
return getContent().firstReversi;
|
||||
}
|
||||
|
||||
public void setVolume(int volume) {
|
||||
getContent().volume = volume;
|
||||
save();
|
||||
@@ -72,4 +88,24 @@ public class SettingsAsset extends JsonAsset<Settings> {
|
||||
getContent().layoutSize = layoutSize;
|
||||
save();
|
||||
}
|
||||
|
||||
public void setTutorialFlag(boolean tutorialFlag) {
|
||||
getContent().showTutorials = tutorialFlag;
|
||||
save();
|
||||
}
|
||||
|
||||
public void setFirstTTT(boolean firstTTT) {
|
||||
getContent().firstTTT = firstTTT;
|
||||
save();
|
||||
}
|
||||
|
||||
public void setFirstConnect4(boolean firstConnect4) {
|
||||
getContent().firstConnect4 = firstConnect4;
|
||||
save();
|
||||
}
|
||||
|
||||
public void setFirstReversi(boolean firstReversi) {
|
||||
getContent().firstReversi = firstReversi;
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,9 @@ public class Settings {
|
||||
public int volume = 100;
|
||||
public int fxVolume = 20;
|
||||
public int musicVolume = 15;
|
||||
public Boolean showTutorials;
|
||||
public Boolean firstReversi;
|
||||
public Boolean firstTTT;
|
||||
public Boolean firstConnect4;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user