|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectamazeproject.Cell
public class Cell
Cell Representation Class
Field Summary | |
---|---|
static int |
cellSize
|
int |
col
|
boolean |
isEnd
|
boolean |
isStart
|
static int |
padding
|
int |
row
|
boolean |
visited
|
int[] |
walls
|
int |
weight
|
Constructor Summary | |
---|---|
Cell(Maze parent)
Constructor |
Method Summary | |
---|---|
int |
findAdjacentWall(Cell cell)
Return index of adjacent wall |
java.util.Vector |
findPath()
Find all possible directions from current cell |
int |
getRandomWall()
Return index of random wall |
boolean |
hasAllWalls()
Check if a given cell has all wals |
void |
knockDownWall(Cell cell)
Destroy wall between this and given cell |
void |
knockDownWall(int wall)
Destroy given wall |
void |
paint(java.awt.Graphics g)
Paint cell |
java.lang.String |
toString()
Function used for getting a string representation of object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int cellSize
public static int padding
public int[] walls
public int row
public int col
public int weight
public boolean visited
public boolean isStart
public boolean isEnd
Constructor Detail |
---|
public Cell(Maze parent)
Maze
- Reference to parent objectMethod Detail |
---|
public boolean hasAllWalls()
public void knockDownWall(int wall)
int
- Wall to be destroyedpublic void knockDownWall(Cell cell)
Cell
- Reference to cell objectpublic int findAdjacentWall(Cell cell)
Cell
- Reference to cell object
public java.util.Vector findPath()
public int getRandomWall()
public void paint(java.awt.Graphics g)
Graphics
- Graphics objectpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |