Main Page | Namespace List | Class Hierarchy | Data Structures | File List | Data Fields | Globals

GameTile Class Reference

#include <GameTile.h>


Public Types

enum  InvisibleState { CLEAN, BOMB, LIFE, TIMEFREEZER }
enum  VisibleState {
  COVERED, UNCOVERED, COVERED_ACTIVE, UNCOVERED_ACCTIVE,
  COVERED_BOMB_MARKED, COVERED_BOMB_PROPOSED, EXPLODE
}

Public Member Functions

void addModel (Model *m)
void addNeighbor (GameTile *gt)
 GameTile (InvisibleState invState, VisibleState visState)
 GameTile ()
int getBombCounter ()
int getGoodieCounter ()
void renderModel ()
void setInvisibleState (InvisibleState s)
void setVisibleState (VisibleState s)
void uncover ()

Data Fields

int bombCounter
InvisibleState currentIState
VisibleState currentVState
int goodieCounter
vector< Model * > modelList
vector< GameTile * > neighborList


Member Enumeration Documentation

enum InvisibleState
 

This enumeration contains the "value" a GameTile.

Responding to the InvisibleState of the GameTile, the next valid VisibleState is set.

CLEAN
if it has no Item
BOMB
if there's a BOMB, next visible state when uncoverd is explode
LIFE
if there is a LIFE, the character will get a life when the tile is uncoverd
TIMEFREEZER
if ther is a TIMEFREEZER, the timer will be stopped for 5 sec.
Enumeration values:
CLEAN 
BOMB 
LIFE 
TIMEFREEZER 

Definition at line 38 of file GameTile.h.

enum VisibleState
 

This enumeration contains valid VisibleStates.

Each VisibleState represents a model in the modelList.

COVERED
The tile is simply covered. This is an initial state
UNCOVERED
The tile is unoverered. Respondig to the bombCounter and the goodieCounter, the UNCOVERED state is attacched to different models.
COVERED_BOMB_MARKED
The tile is covered and a bomb is marked.
COVERED_BOMB_PROPOSED
The tile is covered and a bomb was proposed
EXPLODE
Enumeration values:
COVERED 
UNCOVERED 
COVERED_ACTIVE 
UNCOVERED_ACCTIVE 
COVERED_BOMB_MARKED 
COVERED_BOMB_PROPOSED 
EXPLODE 

Definition at line 58 of file GameTile.h.


Constructor & Destructor Documentation

GameTile  ) 
 

Creates a game tile with the GameTile::InvisibleState CLEAN and the GameTile::VisibleState=COVERED.

Definition at line 21 of file GameTile.cpp.

References bombCounter, CLEAN, COVERED, currentIState, currentVState, and goodieCounter.

GameTile InvisibleState  invState,
VisibleState  visState
 

Creates a game tile with the GameTile::InvisibleState = invState and the GameTile::VisibleState = visState.

Parameters:
invState a GameTile::InvisibleState
visState a GameTile::VisibleState

Definition at line 36 of file GameTile.cpp.

References bombCounter, currentIState, currentVState, and goodieCounter.


Member Function Documentation

void addModel Model m  ) 
 

Adds a model to the modelList of the GameTile.

The modelList references the possible Models for that GameTile.

Parameters:
*m a pointer to a Model

Definition at line 88 of file GameTile.cpp.

References modelList.

Referenced by GameArea::GameArea().

void addNeighbor GameTile gt  ) 
 

Adds a reference to a GameTile to the neighborList.

Attention:
The function does not check wether the given GameTile is realy in the neighborhood.
Parameters:
*gt a referencce to a GameTile in the neighborhood

Definition at line 100 of file GameTile.cpp.

References neighborList.

Referenced by GameArea::GameArea().

int getBombCounter  ) 
 

Returns the current bombCounter.

Returns:
bombCounter the current bombCounter of the GameTile

Definition at line 149 of file GameTile.cpp.

References bombCounter.

int getGoodieCounter  ) 
 

Returns the current goodieCounter.

Returns:
bombCounter the current goodieCounter of the GameTile

Definition at line 159 of file GameTile.cpp.

References goodieCounter.

void renderModel  ) 
 

This function renders the current VisibleState.

Therefore the responding model, referencen in the modelList, is searched and it's render() function is called.

Definition at line 70 of file GameTile.cpp.

References currentVState, modelList, and UNCOVERED.

Referenced by GameArea::renderGameArea().

void setInvisibleState InvisibleState  s  ) 
 

Set the current InvisibleState to the given InvisibleState s.

Parameters:
s a constant from GameTile::InvisibleState

Definition at line 49 of file GameTile.cpp.

References currentIState.

Referenced by GameArea::spreadItems().

void setVisibleState VisibleState  s  ) 
 

Set the current VisibleState to the given VisibleState s.

Parameters:
s a constant from GameTile::VisibleState

Definition at line 59 of file GameTile.cpp.

References currentVState.

Referenced by uncover().

void uncover  ) 
 

This function switches the current VisibleState to UNCOVERED and invokes some further procedures responding to it's InvisibleState.

When calling uncover, the VisibleState will be updated. Therefore the function renderModel() will show another model when called the next time.

Definition at line 111 of file GameTile.cpp.

References BOMB, bombCounter, CLEAN, COVERED, currentIState, currentVState, goodieCounter, LIFE, neighborList, setVisibleState(), TIMEFREEZER, and UNCOVERED.

Referenced by GameArea::uncoverTile().


Field Documentation

int bombCounter
 

stores the number of bombs, near the field

Definition at line 65 of file GameTile.h.

Referenced by GameArea::debugArrays(), GameTile(), getBombCounter(), GameArea::spreadItems(), and uncover().

InvisibleState currentIState
 

Stores the current invisible state.

Definition at line 61 of file GameTile.h.

Referenced by GameArea::debugArrays(), GameTile(), setInvisibleState(), GameArea::spreadItems(), and uncover().

VisibleState currentVState
 

stores the current visible state

Definition at line 63 of file GameTile.h.

Referenced by GameTile(), renderModel(), setVisibleState(), and uncover().

int goodieCounter
 

stored the number of goodies near to the field

Definition at line 67 of file GameTile.h.

Referenced by GameArea::debugArrays(), GameTile(), getGoodieCounter(), GameArea::spreadItems(), and uncover().

vector<Model*> modelList
 

list of possible renderings

Definition at line 70 of file GameTile.h.

Referenced by addModel(), and renderModel().

vector<GameTile*> neighborList
 

references of neighbor GameTiles

Definition at line 72 of file GameTile.h.

Referenced by addNeighbor(), GameArea::spreadItems(), and uncover().


Generated on Fri Apr 8 00:11:48 2005 for Quaxbomber by  doxygen 1.4.1