Pac-Man
|
A class representing map in a game. More...
#include <CMap.h>
Classes | |
class | CMapCoordinates |
Class that represents coordinates in a (CMap) map. More... | |
Public Member Functions | |
CMap (const vector< vector< SGameObjectInfo >> &mapFields, const vector< SGameObjectInfo > &bonuses) | |
A constructor of CMap. More... | |
pair< bool, SGameObjectInfo > | pickBonus (SCoordinates &coordinates) |
Check if bonus can be picked. More... | |
void | reset () |
Resets the map (bonuses) | |
CMapCoordinates | getMapCoordinates (const SCoordinates &coordinates) const |
returns map CMapCoordinates set by SCoordinates and CMap More... | |
void | getStaticBonuses (vector< SGameObjectInfo > &toFill) const |
Fill all static bonuses that were not picked. More... | |
SSize | mapSize () const |
get size of map More... | |
EGameObject | getField (const SCoordinates &coordinates) const |
returns map field of the map (not bonuses) More... | |
SCoordinates | getRandomTile () const |
returns random tile in the map More... | |
SCoordinates | getEmptyTileInMiddle () const |
Returns closest tile to the middle that is empty. More... | |
A class representing map in a game.
CMap::CMap | ( | const vector< vector< SGameObjectInfo >> & | mapFields, |
const vector< SGameObjectInfo > & | bonuses | ||
) |
A constructor of CMap.
[in] | mapFields | fields of the map, that will create the map |
[in] | bonuses | bonuses on the created map |
SCoordinates CMap::getEmptyTileInMiddle | ( | ) | const |
Returns closest tile to the middle that is empty.
EGameObject CMap::getField | ( | const SCoordinates & | coordinates | ) | const |
returns map field of the map (not bonuses)
[in] | coordinates | Map object on those coordinates will be returned |
CMap::CMapCoordinates CMap::getMapCoordinates | ( | const SCoordinates & | coordinates | ) | const |
returns map CMapCoordinates set by SCoordinates and CMap
[in] | coordinates | CMapCoordinates will be created with those coordinates |
SCoordinates CMap::getRandomTile | ( | ) | const |
returns random tile in the map
void CMap::getStaticBonuses | ( | vector< SGameObjectInfo > & | toFill | ) | const |
Fill all static bonuses that were not picked.
[out] | toFill | vector that will be filled with remaining (still not picked) bonuses |
SSize CMap::mapSize | ( | ) | const |
get size of map
pair< bool, SGameObjectInfo > CMap::pickBonus | ( | SCoordinates & | coordinates | ) |
Check if bonus can be picked.
[in] | coordinates | coordinates that will be checked for bonus |