10 //TODO rewrite saver
18 }
37 }
38 rl++;
39 }
42 }
45 }
64 }
65 }
66 }
70 }
72 }
75 // FileHandle file = Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/game.sav");
76 // GameProc gameProc = null;
77 // try {
78 // ObjectInputStream in = new ObjectInputStream(file.read());
79 // int ver = in.readInt();
80 // if (VERSION == ver) {
81 // gameProc = (GameProc) in.readObject();
82 // } else {
83 // throw new Exception("version mismatch");
84 // }
85 // in.close();
86 // gameProc.world = new GameWorld(
87 // loadMap(Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/foremap.sav")),
88 // loadMap(Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/backmap.sav"))
89 // );
90 // gameProc.physics = new GamePhysics();
91 // gameProc.input = new GameInput();
92 // } catch (Exception e) {
93 // Gdx.app.error("GameSaver", e.getMessage(), e);
94 // Gdx.app.exit();
95 // }
96 // return gameProc;
98 }
101 // FileHandle file = Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/");
102 // file.mkdirs();
103 // file = Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/game.sav");
104 // try {
105 // ObjectOutputStream out = new ObjectOutputStream(file.write(false));
106 // out.writeInt(VERSION);
107 // out.writeObject(gp);
108 // out.close();
109 // saveMap(Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/foremap.sav"), gp.world.getFullForeMap());
110 // saveMap(Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/backmap.sav"), gp.world.getFullBackMap());
111 // } catch (Exception e) {
112 // e.printStackTrace();
113 // }
114 }
117 // return (Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/game.sav").exists() &&
118 // Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/foremap.sav").exists() &&
119 // Gdx.files.absolute(CaveGame.GAME_FOLDER + "/saves/backmap.sav").exists());
121 }
123 }