diff --git a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java index a9a702e..986dcc5 100644 --- a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java +++ b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java @@ -157,16 +157,16 @@ //areaInfo処理 public void setAreaInfo(int areaId, AreaInformation AreaInfo){ this.areaInfo.put(areaId,AreaInfo); - this.theWorld.setAreaInfo(areaInfo); - SharedPreferences pref = getSharedPreferences("pref",MODE_PRIVATE); -//// SharedPreferences prefData = getSharedPreferences("pref_data", MODE_PRIVATE); -//// SharedPreferences.Editor editor = prefData.edit(); -//// editor.putString("AreaInfo", String.valueOf(areaInfo)); -//// editor.commit(); - Gson gson = new Gson(); - gson.toJson(theWorld); - pref.edit().putString("Area",gson.toJson(theWorld)).commit(); -// ObjectStorage.save(theWorld,CachePref.KEY_AREA_INFO); +// this.theWorld.setAreaInfo(areaInfo); +// SharedPreferences pref = getSharedPreferences("pref",MODE_PRIVATE); +////// SharedPreferences prefData = getSharedPreferences("pref_data", MODE_PRIVATE); +////// SharedPreferences.Editor editor = prefData.edit(); +////// editor.putString("AreaInfo", String.valueOf(areaInfo)); +////// editor.commit(); +// Gson gson = new Gson(); +// gson.toJson(theWorld); +// pref.edit().putString("Area",gson.toJson(theWorld)).commit(); +//// ObjectStorage.save(theWorld,CachePref.KEY_AREA_INFO); } public AreaInformation getAreaInfo(int areaId){ // SharedPreferences prefData = getSharedPreferences("pref_data", MODE_PRIVATE); @@ -175,10 +175,10 @@ // this.theWorld = ObjectStorage.get(CachePref.KEY_AREA_INFO,Area.class); // this.areaInfo = this.theWorld.getAreaInfo(); - SharedPreferences pref = getSharedPreferences("pref",MODE_PRIVATE); - Gson gson = new Gson(); - theWorld = gson.fromJson(pref.getString("Area",""),Area.class); - this.areaInfo = this.theWorld.getAreaInfo(); +// SharedPreferences pref = getSharedPreferences("pref",MODE_PRIVATE); +// Gson gson = new Gson(); +// theWorld = gson.fromJson(pref.getString("Area",""),Area.class); +// this.areaInfo = this.theWorld.getAreaInfo(); return areaInfo.get(areaId); } @@ -190,7 +190,7 @@ theWorld = gson.fromJson(pref.getString("Area",""),Area.class); if(theWorld != null) { this.areaInfo = this.theWorld.getAreaInfo(); - + this.areaInfoKey.clear(); for (int key : areaInfo.keySet()) { areaInfoKey.add(key); }