public class Room
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
desc
Room description
|
Exit[] |
exits
The list of exits in this room
|
boolean |
hasMagic
Whether it is a room or a corridor
|
boolean |
hasMonster
Whether it is a room or a corridor
|
boolean |
hasSpecial
Whether it is a room or a corridor
|
boolean |
hasTrap
Whether it is a room or a corridor
|
boolean |
hasTreasure
Whether it is a room or a corridor
|
boolean |
isRoom
Whether it is a room or a corridor
|
java.lang.String |
magicPhenomenon
Room description
|
Enemy |
monster
The enemy in this room
|
int |
number
The unique number of the room
|
java.lang.String |
specialPhenomenon
Room description
|
Trap |
trap
The trap in this room
|
Treasure |
treasure
The treasure in this room
|
Dungeon.Type |
type
The room generation type
|
Constructor and Description |
---|
Room(Exit predecessor,
int numberOfExits,
boolean room,
java.lang.String desc,
Counter c)
Constructs a room with a given predecessor, number of exits, description and counter
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Room> |
generate(Counter c,
Dungeon.Type type)
Generates the content of the room
|
static Room |
RandomRoom(boolean first,
Exit predecessor,
Counter c,
Dungeon.Type type)
Generates a random room
|
java.lang.String |
toLongString()
Returns a long description
|
java.lang.String |
toShortString()
Returns a short description
|
java.lang.String |
toString() |
public int number
public Exit[] exits
public Dungeon.Type type
public boolean isRoom
public boolean hasMonster
public boolean hasTrap
public boolean hasMagic
public boolean hasSpecial
public boolean hasTreasure
public Enemy monster
public Treasure treasure
public Trap trap
public java.lang.String desc
public java.lang.String magicPhenomenon
public java.lang.String specialPhenomenon
public Room(Exit predecessor, int numberOfExits, boolean room, java.lang.String desc, Counter c)
predecessor
- Predecessor roomnumberOfExits
- Number of exitsroom
- Whether it is a roomdesc
- Description of roomc
- Room counterpublic java.util.List<Room> generate(Counter c, Dungeon.Type type)
c
- Room countertype
- Environment typepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toLongString()
public java.lang.String toShortString()
public static Room RandomRoom(boolean first, Exit predecessor, Counter c, Dungeon.Type type)
first
- Whether it is the first roompredecessor
- Predecessor roomc
- Room countertype
- Environment type