|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class Room
|
|
|
|
|
|
{
|
|
|
|
|
|
private int id;
|
|
|
|
|
|
private String name;
|
|
|
|
|
|
private String description;
|
|
|
|
|
|
private boolean gameoverFlag;
|
|
|
|
|
|
ArrayList<Item> items = new ArrayList<>();
|
|
|
|
|
|
ArrayList<Puzzle> puzzles = new ArrayList<>();
|
|
|
|
|
|
public Room(String name)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.name = name;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Item getItem(String s)
|
|
|
|
|
|
{
|
|
|
|
|
|
for(Item i: items)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(i.getName().equals(s))
|
|
|
|
|
|
return i;
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Puzzle getPuzzle(String s)
|
|
|
|
|
|
{
|
|
|
|
|
|
for(Puzzle p: puzzles)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(p.getName().equals(s))
|
|
|
|
|
|
return p;
|
|
|
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
|
|
return id;
|
|
|
|
|
|
}
|
|
|
|
|
|
public void setId(int id) {
|
|
|
|
|
|
this.id = id;
|
|
|
|
|
|
}
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
|
return name;
|
|
|
|
|
|
}
|
|
|
|
|
|
public void setName(String name) {
|
|
|
|
|
|
this.name = name;
|
|
|
|
|
|
}
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
|
return description;
|
|
|
|
|
|
}
|
|
|
|
|
|
public void setDescription(String description) {
|
|
|
|
|
|
this.description = description;
|
|
|
|
|
|
}
|
|
|
|
|
|
public boolean getGameoverFlag() {
|
|
|
|
|
|
return gameoverFlag;
|
|
|
|
|
|
}
|
|
|
|
|
|
public void setGameoverFlag(boolean gameOverFlag) {
|
|
|
|
|
|
gameoverFlag = gameOverFlag;
|
|
|
|
|
|
}
|
|
|
|
|
|
public ArrayList<Item> getItems() {
|
|
|
|
|
|
return items;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ArrayList<Puzzle> getPuzzles() {
|
|
|
|
|
|
return puzzles;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|