public class Cave
extends java.lang.Object
| Constructor and Description |
|---|
Cave(java.lang.String name,
int num,
java.util.ArrayList<java.lang.Integer> adj)
Constructs a cave with the specified characteristics.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAdjNumber(int tunnel)
Accesses the number of an adjacent cave.
|
java.lang.String |
getCaveName()
Accesses the name of the cave, or "unknown" if yet to be visited.
|
int |
getCaveNumber()
Accesses the number of the cave.
|
CaveContents |
getContents()
Accesses the contents of the contents (CaveContents.EMPTY, CaveContents.WUMPUS, CaveContents.BATS, or CaveContents.PIT).
|
int |
getNumAdjacent()
Accesses the number of caves adjacent to this one.
|
void |
markAsVisited()
Marks the cave as having been visited.
|
void |
setContents(CaveContents contents)
Sets the contents of the cave (CaveContents.EMPTY, CaveContents.WUMPUS, CaveContents.BATS, or CaveContents.PIT).
|
public Cave(java.lang.String name,
int num,
java.util.ArrayList<java.lang.Integer> adj)
name - the name of the cavenum - the cave numberadj - a list of cave numbers of the adjacent cavespublic int getAdjNumber(int tunnel)
tunnel - the tunnel numberpublic java.lang.String getCaveName()
public int getCaveNumber()
public CaveContents getContents()
public int getNumAdjacent()
public void markAsVisited()
public void setContents(CaveContents contents)
contents - the new contents