Nodes can draw itself and also contain informaion on the node's contents
Public Member Functions | |
GridNode (int x, int y) | |
Constructor for a GridNode These are grid co-ordinates, not pixels. | |
int | pixelCenterX () |
int | pixelCenterY () |
void | setPellet (int i) |
Sets the type of pellet that is in this GridNode. | |
int | getPellet () |
Returns the type of pellet that is in this GridNode. | |
void | paint (Graphics g) |
This function is responsible for painting the GridNode. | |
void | setLeft (GridNode n) |
Sets the pointer to the GridNode to the left of this one on the game board. | |
void | setRight (GridNode n) |
Sets the pointer to the GridNode to the right of this one on the game board. | |
void | setUp (GridNode n) |
Sets the pointer to the GridNode up from this one on the game board. | |
void | setDown (GridNode n) |
Sets the pointer to the GridNode down from this one on the game board. | |
GridNode | getLeft () |
Gets the pointer to the GridNode left from this one on the game board. | |
GridNode | getRight () |
Gets the pointer to the GridNode right from this one on the game board. | |
GridNode | getUp () |
Gets the pointer to the GridNode up from this one on the game board. | |
GridNode | getDown () |
Gets the pointer to the GridNode down from this one on the game board. | |
Static Public Member Functions | |
void | setSize (int i) |
int | getSize () |
Static Public Attributes | |
final int | NO_PELLET = 0 |
Enum value for the pellet_ member. | |
final int | SMALL_PELLET = 1 |
Enum value for the pellet_ member. | |
final int | BIG_PELLET = 2 |
Enum value for the pellet_ member. | |
Private Attributes | |
int | pellet_ |
Defines the type of pellet that is in the GridNode. | |
int | posX_ |
Position of this GridNode in the X axis. | |
int | posY_ |
Position of this GridNode in the Y axis. | |
GridNode | left_ |
Pointer to the GridNode to the left of this one on the game board. | |
GridNode | right_ |
Pointer to the GridNode to the right of this one on the game board. | |
GridNode | up_ |
Pointer to the GridNode up from this one on the game board. | |
GridNode | down_ |
Pointer to the GridNode down from this one on the game board. | |
int | pixelULX_ |
X pixel coord of the Upper Left corner of this GridNode. | |
int | pixelULY_ |
Y pixel coord of the Upper Left corner of this GridNode. | |
int | pixelLRX_ |
X pixel coord of the Lower Right corner of this GridNode. | |
int | pixelLRY_ |
Y pixel coord of the Lower Right corner of this GridNode. | |
int | pixelCX_ |
X pixel coord of the Center of this GridNode. | |
int | pixelCY_ |
Y pixel coord of the Center of this GridNode. | |
Static Private Attributes | |
int | size_ |
Defines the size of the grid squares. |
|
Constructor for a GridNode These are grid co-ordinates, not pixels.
|
|
Gets the pointer to the GridNode down from this one on the game board. This value is null when there is no path for actors to move down.
|
|
Gets the pointer to the GridNode left from this one on the game board. This value is null when there is no path for actors to move left.
|
|
Returns the type of pellet that is in this GridNode.
|
|
Gets the pointer to the GridNode right from this one on the game board. This value is null when there is no path for actors to move right.
|
|
|
|
Gets the pointer to the GridNode up from this one on the game board. This value is null when there is no path for actors to move up.
|
|
This function is responsible for painting the GridNode.
|
|
|
|
|
|
Sets the pointer to the GridNode down from this one on the game board. This value is null when there is no path for actors to move down.
|
|
Sets the pointer to the GridNode to the left of this one on the game board. This value is null when there is no path for actors to move to the left.
|
|
Sets the type of pellet that is in this GridNode.
|
|
Sets the pointer to the GridNode to the right of this one on the game board. This value is null when there is no path for actors to move to the right.
|
|
|
|
Sets the pointer to the GridNode up from this one on the game board. This value is null when there is no path for actors to move up.
|
|
Enum value for the pellet_ member. Large pellets make pacman eat ghosts for a set ammount of time. |
|
Pointer to the GridNode down from this one on the game board. This value is null when there is no path for actors to move down. |
|
Pointer to the GridNode to the left of this one on the game board. This value is null when there is no path for actors to move to the left. |
|
Enum value for the pellet_ member.
|
|
Defines the type of pellet that is in the GridNode. Valid values are
|
|
X pixel coord of the Center of this GridNode.
|
|
Y pixel coord of the Center of this GridNode.
|
|
X pixel coord of the Lower Right corner of this GridNode.
|
|
Y pixel coord of the Lower Right corner of this GridNode.
|
|
X pixel coord of the Upper Left corner of this GridNode.
|
|
Y pixel coord of the Upper Left corner of this GridNode.
|
|
Position of this GridNode in the X axis.
|
|
Position of this GridNode in the Y axis.
|
|
Pointer to the GridNode to the right of this one on the game board. This value is null when there is no path for actors to move to the right. |
|
Defines the size of the grid squares. Units are pixels. |
|
Enum value for the pellet_ member. Small pellets are worth points. |
|
Pointer to the GridNode up from this one on the game board. This value is null when there is no path for actors to move up. |