diff --git a/src/java/Game.java b/src/java/Game.java index 4b59453..150c33b 100644 --- a/src/java/Game.java +++ b/src/java/Game.java @@ -31,7 +31,7 @@ public class Game { Item tonne; public Game() { - try { + try { startGame(); } catch (Exception ex) { Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex); @@ -158,6 +158,29 @@ public class Game { say("das kann nicht geƶffnet werden"); } break; + //intent + case "resetintent": + { + if (itemName == null && puzzleName == null) { + say("Das Spiel wird nun neu gestartet"); + resetGame(); + } + } + //intent + case "skipintent": + { + if (itemName == null && puzzleName == null) { + resetGame(); + for(int i = 0; i < currentRoom.puzzles.size(); i++) + { + if(currentRoom.puzzles.get(i).getNextRoom() != null) + { + setRoom(currentRoom.puzzles.get(i).getNextRoom()); + say(currentRoom.puzzles.get(i).getNextRoom().getDescription()); + } + } + } + } } itemName = null; intentName = null; @@ -177,6 +200,11 @@ public class Game { say(story.get(i)); } } + + public void resetGame(){ + + startGame(); + } public void inspect(String s) { Item currentItem = currentRoom.getItem(s); diff --git a/src/java/Item.java b/src/java/Item.java index f4869cb..f636d0f 100644 --- a/src/java/Item.java +++ b/src/java/Item.java @@ -1,7 +1,6 @@ public class Item { - private int id; private String name; private boolean portableFlag; private boolean hiddenFlag; @@ -21,14 +20,6 @@ public class Item this.description = description; } - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - public String getName() { return name; } diff --git a/src/java/Puzzle.java b/src/java/Puzzle.java index e3c8251..2034a52 100644 --- a/src/java/Puzzle.java +++ b/src/java/Puzzle.java @@ -2,7 +2,6 @@ import java.util.ArrayList; public class Puzzle { - private int id; private String name; private ArrayList items = new ArrayList(); private String description=""; @@ -42,19 +41,11 @@ public class Puzzle { return dependencyText; } - - public int getId() { - return id; - } public Room getNextRoom() { return nextRoom; } - - public void setId(int id) { - this.id = id; - } public void addItem(Item i) { diff --git a/src/java/Room.java b/src/java/Room.java index 639d2f4..85ccb1b 100644 --- a/src/java/Room.java +++ b/src/java/Room.java @@ -3,7 +3,6 @@ import java.util.ArrayList; public class Room { - private int id; private String name; private String description; private boolean gameoverFlag; @@ -34,12 +33,6 @@ public class Room return null; } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } public String getName() { return name; }