From 339df6af13013277a3dfd14124903482e87cc45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Mon, 25 Apr 2016 20:59:28 +0200 Subject: [PATCH] Dungeon.buildDungeon() now properly initializes Gaps & the Replicator --- cicaprojekt/Dungeon.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cicaprojekt/Dungeon.java b/cicaprojekt/Dungeon.java index db65105..62a8a3a 100644 --- a/cicaprojekt/Dungeon.java +++ b/cicaprojekt/Dungeon.java @@ -33,6 +33,7 @@ public class Dungeon { { Tile oneilllocation = null; Tile jaffalocation = null; + Tile replicatorlocation = null; try(BufferedReader reader = new BufferedReader(new FileReader(input))) { String[] sizedata = reader.readLine().split("x"); // read size data at beginning of file @@ -93,6 +94,16 @@ public class Dungeon { dungeon[y][x] = tempscale; scalecount++; break; + + case 'X': + dungeon[y][x] = new Gap(); + break; + + case 'R': + Field replicatorfield = new Field(); + dungeon[y][x] = replicatorfield; + replicatorlocation = replicatorfield; + break; } } } @@ -139,6 +150,7 @@ public class Dungeon { Map playermap = new HashMap<>(); playermap.put("oneill", oneilllocation); playermap.put("jaffa", jaffalocation); + playermap.put("replicator", replicatorlocation); return playermap; }