]> 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 99327bde5241e4d5c55798d3278893729c107feb..f32fa7025cfd22412f2b4872a866753df60cc89f 100644 (file)
@@ -14,7 +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 int tilesetid = R.drawable.classic;
+       public String tilesetid = "classic";
        public boolean gravity=true;
        public boolean timeCounter=true;
 
@@ -84,7 +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);
-               int tilesetid = tilesetStringToRes(sharedPref.getString("pref_tile", ""));
+               String tilesetid = sharedPref.getString("pref_tile", "");
 
                boolean needsReset = false;
 
@@ -118,25 +118,4 @@ public class ShisenSho extends Application {
                }
 
        }
-
-       private int tilesetStringToRes(String s)
-       {
-               if (s.equals("classic")) {
-                       return R.drawable.classic;
-               } else if (s.equals("jade")) {
-                       return R.drawable.jade;
-               } else if (s.equals("traditional")) {
-                       return R.drawable.traditional;
-               } else if (s.equals("pixel")) {
-                       return R.drawable.pixel;
-               } else if (s.equals("original")) {
-                       return R.drawable.original;
-               } else if (s.equals("veit")) {
-                       return R.drawable.veit;
-               } else {
-                       // shouldn't be reached...
-                       Log.e("ShisenSho", "somebody managed to set an invalid tileset string");
-                       return R.drawable.classic;
-               }
-       }
 }
Impressum, Datenschutz