Main Page   Packages   Alphabetical List   Compound List   File List   Compound Members  

GameBoard Class Reference

List of all members.

Detailed Description

A gameborad consists of a vector of GridNodes, and actors.


Public Member Functions

 GameBoard ()
 Simple constructor, takes no parameters.

void addGridNode (GridNode n)
 Adds a GridNode to this board.

void paint (Graphics g)
 Paints the board by calling paint on all GridNodes, pacman, and each ghost.

boolean advanceFrame ()
 advance all actors one frame:

void setPacman (PacmanActor p)
PacmanActor getPacman ()
void addGhost (GhostActor ghost)
 Adds a GhostActor to this board.


Public Attributes

PacmanActor pacman_
 The pacman for this board.


Static Public Attributes

final int ALIVE = 0
 Enum for a desired state.

final int DEAD = 1

Private Attributes

Vector nodes_
 A vector containing all of the GridNodes in this board.

Vector ghosts_
 A vector containing all of the active GhostActors on this board.

int state_
 The state of the GameBoard state can be : ALIVE, DEAD.


Constructor & Destructor Documentation

GameBoard.GameBoard  ) 
 

Simple constructor, takes no parameters.


Member Function Documentation

void GameBoard.addGhost GhostActor  ghost  ) 
 

Adds a GhostActor to this board.

Parameters:
ghost the ghost to add.

void GameBoard.addGridNode GridNode  n  ) 
 

Adds a GridNode to this board.

boolean GameBoard.advanceFrame  ) 
 

advance all actors one frame:

Returns:
true if pacman has enough lives otherwise false

PacmanActor GameBoard.getPacman  ) 
 

Returns:
the PacmanActor for this board

void GameBoard.paint Graphics  g  ) 
 

Paints the board by calling paint on all GridNodes, pacman, and each ghost.

Parameters:
g Graphics object where drawing should take place.

void GameBoard.setPacman PacmanActor  p  ) 
 

Parameters:
p the PacmanActor for this board


Member Data Documentation

final int GameBoard.ALIVE = 0 [static]
 

Enum for a desired state.

final int GameBoard.DEAD = 1 [static]
 

Vector GameBoard.ghosts_ [private]
 

A vector containing all of the active GhostActors on this board.

Vector GameBoard.nodes_ [private]
 

A vector containing all of the GridNodes in this board.

PacmanActor GameBoard.pacman_
 

The pacman for this board.

int GameBoard.state_ [private]
 

The state of the GameBoard state can be : ALIVE, DEAD.


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