diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
index 7f23e52..c0fc23d 100644
--- a/nbproject/build-impl.xml
+++ b/nbproject/build-impl.xml
@@ -998,11 +998,17 @@ exists or setup the property manually. For example like this:
+
+
+
+
+
+
diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties
index 33a372f..7b68088 100644
--- a/nbproject/genfiles.properties
+++ b/nbproject/genfiles.properties
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=b50c735c
+build.xml.data.CRC32=20a1ec55
build.xml.script.CRC32=2d64e8d1
build.xml.stylesheet.CRC32=651128d4@1.77.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=b50c735c
-nbproject/build-impl.xml.script.CRC32=74e621b3
+nbproject/build-impl.xml.data.CRC32=20a1ec55
+nbproject/build-impl.xml.script.CRC32=b4f5594b
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
diff --git a/nbproject/project.properties b/nbproject/project.properties
index f81702a..a50e149 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -28,6 +28,9 @@ dist.war=${dist.dir}/${war.name}
endorsed.classpath=\
${libs.javaee-endorsed-api-7.0.classpath}
excludes=
+file.reference.jackson-annotations-2.9.0.jar=C:\\Users\\Edi\\Desktop\\jackson-annotations-2.9.0.jar
+file.reference.jackson-core-2.9.9.jar=C:\\Users\\Edi\\Desktop\\jackson-core-2.9.9.jar
+file.reference.jackson-databind-2.9.9.jar=C:\\Users\\Edi\\Desktop\\jackson-databind-2.9.9.jar
includes=**
j2ee.compile.on.save=true
j2ee.copy.static.files.on.save=true
@@ -42,7 +45,10 @@ j2ee.platform.wsit.classpath=
j2ee.server.type=gfv3ee6
jar.compress=false
javac.classpath=\
- ${libs.javaee-web-api-7.0.classpath}
+ ${libs.javaee-web-api-7.0.classpath}:\
+ ${file.reference.jackson-annotations-2.9.0.jar}:\
+ ${file.reference.jackson-core-2.9.9.jar}:\
+ ${file.reference.jackson-databind-2.9.9.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.debug=true
diff --git a/nbproject/project.xml b/nbproject/project.xml
index dc2a753..c5b1864 100644
--- a/nbproject/project.xml
+++ b/nbproject/project.xml
@@ -10,6 +10,18 @@
${libs.javaee-web-api-7.0.classpath}
WEB-INF/lib
+
+ ${file.reference.jackson-annotations-2.9.0.jar}
+ WEB-INF/lib
+
+
+ ${file.reference.jackson-core-2.9.9.jar}
+ WEB-INF/lib
+
+
+ ${file.reference.jackson-databind-2.9.9.jar}
+ WEB-INF/lib
+
diff --git a/src/java/Game.java b/src/java/Game.java
index b519d4f..061b8f2 100644
--- a/src/java/Game.java
+++ b/src/java/Game.java
@@ -1,34 +1,50 @@
+import com.fasterxml.jackson.core.JsonEncoding;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.BufferedReader;
import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.net.HttpURLConnection;
+import java.util.Map;
+import javax.json.stream.JsonGenerationException;
public class Game {
private static ArrayList rooms = new ArrayList();
private static ArrayList- inventory = new ArrayList
- ();
private static ArrayList story = new ArrayList();
+ private static ArrayList
- items = new ArrayList
- ();
+ private static ArrayList puzzles = new ArrayList();
private boolean stoppFlag = false;
+ private Map jsonMap = null;
+ private String[] inputArray = null;
- String[] inputArray = null;
- String itemName = null;
- String intentName = null;
- String puzzleName = null;
- String input = null;
- Room currentRoom = null;
+ private String itemName = null;
+ private String intentName = null;
+ private String puzzleName = null;
+ private String input = null;
+ private Room currentRoom = null;
- Room intro;
- Room keller;
- Puzzle durchgang;
- Puzzle schloss;
- Puzzle door;
- Item schluessel;
- Item stahlschluessel;
+ private Room intro;
+ private Room keller;
+ private Puzzle durchgang;
+ private Puzzle schloss;
+ private Puzzle door;
+ private Item schluessel;
+ private Item stahlschluessel;
public Game() {
try {
@@ -38,7 +54,83 @@ public class Game {
}
}
- public void setVariables() {
+ public Map readJSON() throws IOException, Exception {
+
+ //TODO: Define path!
+ File file = new File("game.JSON");
+ try {
+ FileReader fr = new FileReader(file);
+ BufferedReader br = new BufferedReader(fr);
+ String jsonObject = br.readLine();
+ ObjectMapper objectMapper = new ObjectMapper();
+
+ try {
+ jsonMap = objectMapper.readValue(jsonObject,
+ new TypeReference