Browse Source

Merge origin/master

master
Edi 5 years ago
parent
commit
5fabb9780e
4 changed files with 29 additions and 26 deletions
  1. 29
    1
      src/java/Game.java
  2. 0
    9
      src/java/Item.java
  3. 0
    9
      src/java/Puzzle.java
  4. 0
    7
      src/java/Room.java

+ 29
- 1
src/java/Game.java View File

@@ -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);

+ 0
- 9
src/java/Item.java View File

@@ -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;
}

+ 0
- 9
src/java/Puzzle.java View File

@@ -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)
{

+ 0
- 7
src/java/Room.java View File

@@ -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;
}

Loading…
Cancel
Save