]> git.zerfleddert.de Git - FreeShisen/blobdiff - src/de/cwde/freeshisen/ShisenSho.java
factor out Tileset stuff. no, this isn't what correct OOA/OOD should look like, but...
[FreeShisen] / src / de / cwde / freeshisen / ShisenSho.java
index f4ee58e702e70b5b975d1d6c63aa7104058697f6..f32fa7025cfd22412f2b4872a866753df60cc89f 100644 (file)
@@ -14,6 +14,7 @@ public class ShisenSho extends Application {
        public int[] boardSize=new int[2];
        public int difficulty=1; // 1=Easy, 2=Hard
        public int size=3; // 1=Small, 2=Medium, 3=Big
+       public String tilesetid = "classic";
        public boolean gravity=true;
        public boolean timeCounter=true;
 
@@ -83,6 +84,7 @@ public class ShisenSho extends Application {
                int difficulty = Integer.parseInt(sharedPref.getString("pref_diff", "1"));
                boolean gravity = sharedPref.getBoolean("pref_grav", true);
                boolean timeCounter = sharedPref.getBoolean("pref_time", true);
+               String tilesetid = sharedPref.getString("pref_tile", "");
 
                boolean needsReset = false;
 
@@ -101,14 +103,19 @@ public class ShisenSho extends Application {
                        needsReset = true;
                }
 
-               if (timeCounter != this.timeCounter) {
+               if ((timeCounter != this.timeCounter) && (view != null)) {
                        this.timeCounter = timeCounter;
                        view.onTimeCounterActivate();
                }
 
+               if ((tilesetid != this.tilesetid) && (view != null)) {
+                       this.tilesetid = tilesetid;
+                       view.loadTileset();
+               }
+
                if (needsReset && (view != null)) {
                        view.reset();
                }
-       }
 
+       }
 }
Impressum, Datenschutz