From 248292905ea424a5bec18c34cb056b60bb813a76 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 25 Nov 2018 16:33:21 +0100 Subject: Add jar recipe in Makefile, move res folder inside package MapLoader was update accordingly to load maps as resources --- Makefile | 9 ++++++-- manifest.txt | 2 ++ res/maps/testmap.json | 1 - src/subconscious/Game.java | 2 +- src/subconscious/MapLoader.java | 41 +++++++++++++--------------------- src/subconscious/res/maps/testmap.json | 1 + 6 files changed, 26 insertions(+), 30 deletions(-) create mode 100644 manifest.txt delete mode 100644 res/maps/testmap.json create mode 100644 src/subconscious/res/maps/testmap.json diff --git a/Makefile b/Makefile index 1f1c3b3..76e4582 100644 --- a/Makefile +++ b/Makefile @@ -28,18 +28,23 @@ endif # recipes -.PHONY: all run pack classes dirs clean +.PHONY: all run jar classes dirs clean all: classes classes: dirs $(JAVAC) $(JAVAC_ARGS) -d build $(SOURCES) + # copy resources folder + cp -r src/subconscious/res build/subconscious/res .ONESHELL: run: classes cd build $(JAVA) $(JAVA_ARGS) $(MAINCLASS) -# TODO: recipe for jar file +.ONESHELL: +jar: classes + cd build + jar cfm subconscious.jar ../manifest.txt `find . -type f` dirs: mkdir -p build diff --git a/manifest.txt b/manifest.txt new file mode 100644 index 0000000..9ecb5af --- /dev/null +++ b/manifest.txt @@ -0,0 +1,2 @@ +Main-Class: subconscious.Subconscious +Class-Path: ../lib/gson-2.6.2.jar diff --git a/res/maps/testmap.json b/res/maps/testmap.json deleted file mode 100644 index 1bfb65e..0000000 --- a/res/maps/testmap.json +++ /dev/null @@ -1 +0,0 @@ -{"size":{"width":15,"height":15},"grid":[{"x":0,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":2,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":8,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":2,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":2,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":9,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":10,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":11,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":1,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":4,"y":2,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":4,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":4,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":4,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":10,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":4,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":2,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":5,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":4,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":8,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":9,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":5,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":6,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":6,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":8,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":11,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":7,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":7,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":8,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":11,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":1,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":8,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":8,"y":3,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":8,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":8,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":8,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":8,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":8,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":9,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":9,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":9,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":12,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":9,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":9,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":10,"y":7,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":10,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":10,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":7,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":8,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":12,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":11,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":12,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":13,"y":3,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":13,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0}],"actors":[{"name":"marc","alive":true,"enemy":true,"hp":10,"agility":10,"strenght":0,"defense":0,"x":12,"y":13},{"name":"bob","alive":true,"enemy":false,"hp":10,"agility":10,"strenght":0,"defense":0,"x":1,"y":4},{"name":"mike","alive":true,"enemy":false,"hp":10,"agility":10,"strenght":0,"defense":0,"x":8,"y":4},{"name":"jack","alive":true,"enemy":false,"hp":10,"agility":10,"strenght":0,"defense":0,"x":1,"y":10}],"actorIndex":-1} diff --git a/src/subconscious/Game.java b/src/subconscious/Game.java index 6f14def..7ef3e8d 100644 --- a/src/subconscious/Game.java +++ b/src/subconscious/Game.java @@ -45,7 +45,7 @@ public class Game { // TODO: this will be replaced with a dynamic mechanism based // on the progress within the game - Map testMap = this.mapLoader.parse("../res/maps/testmap.json"); + Map testMap = this.mapLoader.get("/subconscious/res/maps/testmap.json"); this.currentMap = testMap; this.maps.add(testMap); diff --git a/src/subconscious/MapLoader.java b/src/subconscious/MapLoader.java index 3ece7f0..b7e97d2 100644 --- a/src/subconscious/MapLoader.java +++ b/src/subconscious/MapLoader.java @@ -1,18 +1,16 @@ package subconscious; import java.lang.String; +import java.lang.ClassLoader; // TODO: use java.nio? http://tutorials.jenkov.com/java-nio/nio-vs-io.html -import java.io.File; -import java.io.PrintWriter; -import java.io.FileReader; -import java.io.BufferedReader; -import java.io.FileNotFoundException; +import java.io.InputStream; import java.io.IOException; import java.awt.Dimension; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; // TODO: remove import java.lang.UnsupportedOperationException; @@ -21,7 +19,7 @@ import java.lang.UnsupportedOperationException; // TODO: this class loads AND saves classes, refractor name public class MapLoader { - private Gson gson = new Gson(); + private Gson gson = new GsonBuilder().setPrettyPrinting().create();; public MapLoader() { @@ -32,35 +30,26 @@ public class MapLoader { throw new UnsupportedOperationException(); } - public Map parse(String path) { - File file = new File(path); + public Map get(final String resourceName) { + InputStream is = MapLoader.class.getResourceAsStream(resourceName); + assert is != null; - String mapText = ""; - String line = null; - FileReader fr = null; - BufferedReader bf = null; + int b; + String content = ""; try { - fr = new FileReader(file); - bf = new BufferedReader(fr); - // TODO: read all at once - while ((line = bf.readLine()) != null) { - mapText = mapText + line; + while ((b = is.read()) != -1) { + content += (char) b; } - bf.close(); } catch (IOException ex) { ex.printStackTrace(); } - Map importMap = this.gson.fromJson(mapText, Map.class); - - // TODO: ask @mafaldo why is there a copy? - // update map with new classes - // Map map = new Map(new Dimension(importMap.getSize(), importMap.getSize())); - // map.update(importMap.getActors(), importMap.getGrid()); - // return map; + return this.parse(content); + } - return importMap; + public Map parse(final String json) { + return this.gson.fromJson(json, Map.class); } diff --git a/src/subconscious/res/maps/testmap.json b/src/subconscious/res/maps/testmap.json new file mode 100644 index 0000000..1bfb65e --- /dev/null +++ b/src/subconscious/res/maps/testmap.json @@ -0,0 +1 @@ +{"size":{"width":15,"height":15},"grid":[{"x":0,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":0,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":1,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":2,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":8,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":2,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":2,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":2,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":9,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":10,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":11,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":3,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":3,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":1,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":4,"y":2,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":4,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":4,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":4,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":10,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":4,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":4,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":2,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":5,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":4,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":8,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":9,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":5,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":5,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":5,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":6,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":6,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":8,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":11,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":6,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":6,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":7,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":7,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":8,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":11,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":7,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":7,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":1,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":8,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":8,"y":3,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":8,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":8,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":8,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":8,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":8,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":8,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":9,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":9,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":9,"y":10,"type":"WATER","selected":false,"cost":3.0,"distance":0.0},{"x":9,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":9,"y":12,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":9,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":9,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":10,"y":7,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":10,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":10,"y":13,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":10,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":5,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":7,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":8,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":11,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":11,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":6,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":12,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":11,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":12,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":12,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":2,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":13,"y":3,"type":"MOUNTAIN","selected":false,"cost":8.0,"distance":0.0},{"x":13,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":13,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":0,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":1,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":2,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":3,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":4,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":5,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":6,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":7,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":8,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":9,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":10,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":11,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":12,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":13,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0},{"x":14,"y":14,"type":"GRASS","selected":false,"cost":1.0,"distance":0.0}],"actors":[{"name":"marc","alive":true,"enemy":true,"hp":10,"agility":10,"strenght":0,"defense":0,"x":12,"y":13},{"name":"bob","alive":true,"enemy":false,"hp":10,"agility":10,"strenght":0,"defense":0,"x":1,"y":4},{"name":"mike","alive":true,"enemy":false,"hp":10,"agility":10,"strenght":0,"defense":0,"x":8,"y":4},{"name":"jack","alive":true,"enemy":false,"hp":10,"agility":10,"strenght":0,"defense":0,"x":1,"y":10}],"actorIndex":-1} -- cgit v1.2.1