@@ -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); |
@@ -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; | |||
} |
@@ -2,7 +2,6 @@ import java.util.ArrayList; | |||
public class Puzzle | |||
{ | |||
private int id; | |||
private String name; | |||
private ArrayList<Item> items = new ArrayList<Item>(); | |||
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) | |||
{ |
@@ -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; | |||
} |