saving in project/.rogue-save

v5stable
Ondřej Hruška 11 years ago
parent 494e1a657b
commit 9835cd0023
  1. 1
      .gitignore
  2. BIN
      amap.ion
  3. 6
      src/mightypork/rogue/Paths.java
  4. 4
      src/mightypork/rogue/screens/ingame/WorldLayer.java

1
.gitignore vendored

@ -1,4 +1,5 @@
/bin/ /bin/
/target/ /target/
/.rogue-save/
*.log *.log
.attach_pid* .attach_pid*

Binary file not shown.

@ -3,14 +3,10 @@ package mightypork.rogue;
import java.io.File; import java.io.File;
import mightypork.util.files.OsUtils;
public final class Paths { public final class Paths {
private static final String APPDIR_NAME = "rogue"; public static final File WORKDIR = new File("./.rogue-save");//OsUtils.getWorkDir(APPDIR_NAME);
public static final File WORKDIR = OsUtils.getWorkDir(APPDIR_NAME);
public static final File LOG_FILE = new File(WORKDIR, "runtime.log"); public static final File LOG_FILE = new File(WORKDIR, "runtime.log");

@ -1,6 +1,7 @@
package mightypork.rogue.screens.ingame; package mightypork.rogue.screens.ingame;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Random; import java.util.Random;
@ -9,6 +10,7 @@ import mightypork.gamecore.gui.screens.ScreenLayer;
import mightypork.gamecore.input.InputSystem; import mightypork.gamecore.input.InputSystem;
import mightypork.gamecore.input.KeyStroke; import mightypork.gamecore.input.KeyStroke;
import mightypork.gamecore.input.Keys; import mightypork.gamecore.input.Keys;
import mightypork.rogue.Paths;
import mightypork.rogue.world.MapGenerator; import mightypork.rogue.world.MapGenerator;
import mightypork.rogue.world.World; import mightypork.rogue.world.World;
import mightypork.util.ion.Ion; import mightypork.util.ion.Ion;
@ -26,7 +28,7 @@ public class WorldLayer extends ScreenLayer {
final World w = MapGenerator.createWorld(rand.nextLong()); final World w = MapGenerator.createWorld(rand.nextLong());
try { try {
Ion.toFile("amap.ion", w); Ion.toFile(new File(Paths.WORKDIR,"test-world.ion"), w);
} catch (final IOException e) { } catch (final IOException e) {
e.printStackTrace(); e.printStackTrace();
System.exit(1); System.exit(1);

Loading…
Cancel
Save