summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-12-15 14:59:28 +0100
committerNao Pross <naopross@thearcway.org>2018-12-15 14:59:28 +0100
commit03a92d22027ef0738d1ebfd59145236905751425 (patch)
treef488a709b1180c6f5e82c71c3fcd39c2a71e6576 /src
parentChange Tile.loaded to Tile.active (diff)
downloadSubconscious-java-03a92d22027ef0738d1ebfd59145236905751425.tar.gz
Subconscious-java-03a92d22027ef0738d1ebfd59145236905751425.zip
Remove Gson dependency start custom libjtmx implementation
This commit breaks MapLoader and by consequence the entire game. Being in Java 9+ now we will have multiple modules, namely: - libjtmx: separate minimal tmx (tiled) files loader library - subconscious: the game itself
Diffstat (limited to '')
-rw-r--r--src/libjtmx/Map.java10
-rw-r--r--src/libjtmx/module-info.java3
-rw-r--r--src/subconscious/MapLoader.java6
-rw-r--r--src/subconscious/module-info.java3
4 files changed, 17 insertions, 5 deletions
diff --git a/src/libjtmx/Map.java b/src/libjtmx/Map.java
new file mode 100644
index 0000000..d9333a8
--- /dev/null
+++ b/src/libjtmx/Map.java
@@ -0,0 +1,10 @@
+package libjtmx;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Map {
+
+} \ No newline at end of file
diff --git a/src/libjtmx/module-info.java b/src/libjtmx/module-info.java
new file mode 100644
index 0000000..4dc4197
--- /dev/null
+++ b/src/libjtmx/module-info.java
@@ -0,0 +1,3 @@
+module libjtmx {
+ requires java.xml.bind;
+} \ No newline at end of file
diff --git a/src/subconscious/MapLoader.java b/src/subconscious/MapLoader.java
index 6fe1273..67425e5 100644
--- a/src/subconscious/MapLoader.java
+++ b/src/subconscious/MapLoader.java
@@ -9,8 +9,6 @@ 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,8 +19,6 @@ public class MapLoader {
public static final String MAPS_RESOURCES_PATH = "/subconscious/res/maps/";
- private Gson gson = new GsonBuilder().setPrettyPrinting().create();;
-
public MapLoader() {
}
@@ -50,7 +46,7 @@ public class MapLoader {
}
public Map parse(final String json) {
- return this.gson.fromJson(json, Map.class);
+ throw new UnsupportedOperationException();
}
// public void saveMap(Map map) {
diff --git a/src/subconscious/module-info.java b/src/subconscious/module-info.java
new file mode 100644
index 0000000..a6d22b9
--- /dev/null
+++ b/src/subconscious/module-info.java
@@ -0,0 +1,3 @@
+module subconscious {
+ requires java.desktop;
+} \ No newline at end of file