#include <GameArea.h>
Public Types | |
enum | Level { EASY, MEDIUM, HARD } |
Public Member Functions | |
bool | createItems (Level l) |
void | debugArrays (bool items, bool bombs, bool goodies) |
GameArea (Level level) | |
void | renderGameArea () |
bool | spreadItems (GameTile::InvisibleState it, int count) |
void | uncoverTile (int v, int h) |
void | updateCounterArray (int index, int x, int y, int v, int *field) |
void | updateCounters (int index, int x, int y, int bombValue, int goodieValue) |
~GameArea () | |
Data Fields | |
CoveredGameTileModel * | coveredGT |
int | dim |
GameTile * | gameTileArray |
Level | level |
int | tiles |
UncoveredGameTileModel * | uncoveredGT |
|
This enumeration stores the levels supported by the game. A GameArea in Quaxbomber is created with a specific level. A level specifies the number of bombs, lifes and timefreezers that are spread all over the GameArea in the beginning of a game. The amount of these items is currently hardcoded in this file (GameArea.h) using macros. Definition at line 57 of file GameArea.h. |
|
The constructor of the GameArea. The constructor does the following:
Definition at line 27 of file GameArea.cpp. References GameTile::addModel(), GameTile::addNeighbor(), coveredGT, createItems(), dim, EASY, EASYSIZE, gameTileArray, HARD, HARDSIZE, MEDIUM, MEDIUMSIZE, tiles, and uncoveredGT. |
|
Definition at line 82 of file GameArea.h. References gameTileArray. |
|
This funtion simply calls the spreadItems(Item it, int count) functions with the Level choosen in the constructor of the game.
Definition at line 216 of file GameArea.cpp. References EASY, EASYBOMBS, EASYLIFES, EASYTIMEF, HARD, HARDBOMBS, HARDLIFES, HARDTIMEF, MEDIUM, MEDIUMBOMBS, MEDIUMLIFES, MEDIUMTIMEF, and spreadItems(). Referenced by GameArea(). |
|
Function to show the values of the goodieCounters, bombCounters as console output. The values of the itemcounters of all GameTiles (e.g.GameTile::bombCounter) are shown as an array on the console. Definition at line 301 of file GameArea.cpp. References GameTile::bombCounter, GameTile::currentIState, dim, gameTileArray, GameTile::goodieCounter, and tiles. |
|
This function is used to render the single GameTiles, referenced by the *gameTileArray.
Definition at line 258 of file GameArea.cpp. References dim, gameTileArray, and GameTile::renderModel(). Referenced by display(). |
|
Spreads a number of items over the GameArea.
This function is used during the creation of a GameArea and it is responsible for the manipulation of the GameTiles referenced by the member variable *gameTileArray. The algorithm is as follows:
Definition at line 170 of file GameArea.cpp. References GameTile::bombCounter, GameTile::currentIState, dim, gameTileArray, GameTile::goodieCounter, GameTile::neighborList, GameTile::setInvisibleState(), and tiles. Referenced by createItems(). |
|
Uncover sets the visibleState of GameTile at vertical and the horizontal position (x axis, z axis). The function simply calculates the offest in the array *gameTileArray, that references the GameTiles. Then it calls the GameTile::uncover() function wich can lead to recursive calls by the GameTile itself.
Definition at line 287 of file GameArea.cpp. References dim, gameTileArray, and GameTile::uncover(). Referenced by keyEvent(). |
|
|
|
|
|
Pointer to an CoveredGameTileModel wich is used in the constructor.
Definition at line 68 of file GameArea.h. Referenced by GameArea(). |
|
The dimension of the GameArea. The size corresponds to the choosen Level Definition at line 75 of file GameArea.h. Referenced by debugArrays(), GameArea(), keyEvent(), renderGameArea(), spreadItems(), and uncoverTile(). |
|
A pointer to an one dimensional array of GameTiles. It's size corresponds to the coosen level. The array is used to manipulated the rendering states of the single GameTiles that are referenced. Definition at line 65 of file GameArea.h. Referenced by debugArrays(), GameArea(), renderGameArea(), spreadItems(), uncoverTile(), and ~GameArea(). |
|
The level choosen to create the GameArea. The value is set in the constructor Definition at line 73 of file GameArea.h. |
|
The number of tiles = the size of the gameTileArray.
Definition at line 77 of file GameArea.h. Referenced by debugArrays(), GameArea(), and spreadItems(). |
|
Pointer to an UncoveredGameTileModel wich is used in the constructor.
Definition at line 70 of file GameArea.h. Referenced by GameArea(). |