Main Page   Packages   Alphabetical List   Compound List   File List   Compound Members  

GridNode Class Reference

List of all members.

Detailed Description

Represents a cell on the gameboard.

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 & Destructor Documentation

GridNode.GridNode int  x,
int  y
 

Constructor for a GridNode These are grid co-ordinates, not pixels.

  • Parameters:
    x Position of this GridNode in the X axis.
    y Position of this GridNode in the Y axis.


Member Function Documentation

GridNode GridNode.getDown  ) 
 

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.

Returns:
GridNode object or null

GridNode GridNode.getLeft  ) 
 

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:
GridNode object or null

int GridNode.getPellet  ) 
 

Returns the type of pellet that is in this GridNode.

  • Valid values are
    • NO_PELLET
    • SMALL_PELLET
    • BIG_PELLET
      Returns:
      *_PELLET enum.

GridNode GridNode.getRight  ) 
 

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.

Returns:
GridNode object or null

int GridNode.getSize  )  [static]
 

Returns:
The size in pixels for all GridNode objects

GridNode GridNode.getUp  ) 
 

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.

Returns:
GridNode object or null

void GridNode.paint Graphics  g  ) 
 

This function is responsible for painting the GridNode.

Parameters:
g Graphics object where drawing should take place.

int GridNode.pixelCenterX  ) 
 

Returns:
the X pixel coord of the Center of this GridNode

int GridNode.pixelCenterY  ) 
 

Returns:
the X pixel coord of the Center of this GridNode

void GridNode.setDown GridNode  n  ) 
 

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.

Parameters:
n GridNode object or null

void GridNode.setLeft GridNode  n  ) 
 

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.

Parameters:
n GridNode object or null

void GridNode.setPellet int  i  ) 
 

Sets the type of pellet that is in this GridNode.

  • Valid values are
    • NO_PELLET
    • SMALL_PELLET
    • BIG_PELLET
      Parameters:
      i *_PELLET enum.

void GridNode.setRight GridNode  n  ) 
 

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.

Parameters:
n GridNode object or null

void GridNode.setSize int  i  )  [static]
 

Parameters:
i size in pixels for all GridNode objects

void GridNode.setUp GridNode  n  ) 
 

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.

Parameters:
n GridNode object or null


Member Data Documentation

final int GridNode.BIG_PELLET = 2 [static]
 

Enum value for the pellet_ member.

Large pellets make pacman eat ghosts for a set ammount of time.

GridNode GridNode.down_ [private]
 

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.

GridNode GridNode.left_ [private]
 

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.

final int GridNode.NO_PELLET = 0 [static]
 

Enum value for the pellet_ member.

int GridNode.pellet_ [private]
 

Defines the type of pellet that is in the GridNode.

Valid values are

  • NO_PELLET
  • SMALL_PELLET
  • BIG_PELLET

int GridNode.pixelCX_ [private]
 

X pixel coord of the Center of this GridNode.

int GridNode.pixelCY_ [private]
 

Y pixel coord of the Center of this GridNode.

int GridNode.pixelLRX_ [private]
 

X pixel coord of the Lower Right corner of this GridNode.

int GridNode.pixelLRY_ [private]
 

Y pixel coord of the Lower Right corner of this GridNode.

int GridNode.pixelULX_ [private]
 

X pixel coord of the Upper Left corner of this GridNode.

int GridNode.pixelULY_ [private]
 

Y pixel coord of the Upper Left corner of this GridNode.

int GridNode.posX_ [private]
 

Position of this GridNode in the X axis.

  • These are grid co-ordinates, not pixels.
  • This is specified during object construction.

int GridNode.posY_ [private]
 

Position of this GridNode in the Y axis.

  • These are grid co-ordinates, not pixels.
  • This is specified during object construction.

GridNode GridNode.right_ [private]
 

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.

int GridNode.size_ [static, private]
 

Defines the size of the grid squares.

Units are pixels.

final int GridNode.SMALL_PELLET = 1 [static]
 

Enum value for the pellet_ member.

Small pellets are worth points.

GridNode GridNode.up_ [private]
 

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.


The documentation for this class was generated from the following file:
Generated on Tue May 13 00:53:02 2003 for PACMAN by doxygen1.3