Labyrinth
A labyrinth game assignment
|
A utility class used for room prevent algorithm. More...
Package Functions | |
Edge (int tileId, int direction) | |
This constructor acts as the interface between the application's wall representation and the one based on graph. More... | |
Edge (Edge e) | |
A deep copy contructor. More... | |
int | getV1 () |
Access of the first node of the edge. More... | |
int | getV2 () |
Access of the second node of the edge. More... | |
Private Attributes | |
int | v1 |
First vertex of the edge. More... | |
int | v2 |
Second vertex of the edge. More... | |
A utility class used for room prevent algorithm.
This class is the wall representation we use in the room preventing algorithm. In this algorithm we represent the crosses between tiles as nodes (V) of a graph and the walls as edges. So for example:
12--13--14---15 | | 8 9--10 11 | | | 4 5 6 7 | | | 0 1---2---3
In this example we have a 4x4=16 vertices board(nodes) and 14 edges(walls). To represent the vertices on the board we use the same trick as the tileId
V = Row*(N+1) + Column, where N is the board's tile size.
The edges are represented as vertices pairs. For example (0, 4) or (13, 14).
Definition at line 263 of file Common.java.
|
package |
This constructor acts as the interface between the application's wall representation and the one based on graph.
tileId | The tile id of the wall. |
direction | The direction of the tile where the wall should be. |
Definition at line 270 of file Common.java.
|
package |
A deep copy contructor.
Definition at line 292 of file Common.java.
|
package |
Access of the first node of the edge.
Definition at line 297 of file Common.java.
|
package |
Access of the second node of the edge.
Definition at line 299 of file Common.java.
|
private |
First vertex of the edge.
Definition at line 301 of file Common.java.
|
private |
Second vertex of the edge.
Definition at line 302 of file Common.java.