Modifier and Type | Field and Description |
---|---|
private java.lang.String |
description |
private java.lang.String |
name |
private Room |
room |
private java.lang.String |
state |
Constructor and Description |
---|
Creature(java.lang.String n,
java.lang.String d) |
Modifier and Type | Method and Description |
---|---|
boolean |
allRoomsFull()
Determine if all of the adjacent rooms are full or not
|
(package private) abstract void |
checkRoom() |
(package private) abstract void |
clean() |
int |
compareTo(Creature o)
Compare one creature to another creature
|
int |
compareTo(java.lang.String o)
Compare one creature to a string
|
(package private) abstract void |
dirty() |
void |
drillThroughRoof()
Force the Creature to leave the house and remove all references of it
|
(package private) abstract void |
expressDiscontent() |
(package private) abstract void |
expressGladness() |
Room |
getRoom()
Gets the room the animal is in
|
java.lang.String |
getState()
Gets the state of the room
|
void |
moveDirection(int direction)
Move the creature in a specified direction, based on the same movement
mechanic used in room
|
boolean |
moveRoom(Room r)
moves creature from one room to another
|
java.lang.String |
name()
Gets only the name of the Creature
|
(package private) abstract void |
notifyCreature() |
void |
setDescription(java.lang.String d)
Sets the description of the creature
|
void |
setName(java.lang.String n)
Sets the name of the creature
|
void |
setRoom(Room r)
Sets the current Room
|
void |
setRoomState(java.lang.String s)
Sets the state of the room
|
void |
setState(java.lang.String s)
Sets the state of the room
|
java.lang.String |
toString() |
private java.lang.String name
private java.lang.String description
private Room room
private java.lang.String state
abstract void notifyCreature()
abstract void expressGladness()
abstract void expressDiscontent()
abstract void checkRoom()
abstract void clean()
abstract void dirty()
public void setState(java.lang.String s)
s
- String state of the roompublic java.lang.String getState()
public void setRoom(Room r)
r
- A roompublic boolean moveRoom(Room r)
r
- The room to move topublic void setRoomState(java.lang.String s)
s
- The statepublic void setName(java.lang.String n)
n
- The namepublic void setDescription(java.lang.String d)
d
- A descriptionpublic Room getRoom()
public void moveDirection(int direction)
direction
- direction of movement (0 1 2 3) -> (N E S W)public java.lang.String name()
public boolean allRoomsFull()
public void drillThroughRoof()
public int compareTo(Creature o)
o
- The creature referencepublic int compareTo(java.lang.String o)
o
- The string being searchedpublic java.lang.String toString()
toString
in class java.lang.Object
Harry Scells 2015 CSC241