Class that holds info about current played game.
More...
#include <CGameInfo.h>
Class that holds info about current played game.
◆ CGameInfo()
CGameInfo::CGameInfo |
( |
uint32_t |
time, |
|
|
SGameParameters |
gameParameters, |
|
|
unsigned int |
numberOfBonuses |
|
) |
| |
Constructs new game info to a new game.
- Parameters
-
[in] | time | time from the start of the game |
[in] | gameParameters | parameters of the game, which would be played |
[in] | numberOfBonuses | number of all static (non-moving) bonuses at the start of the game |
◆ bonusWasPicked()
The method by which game info is informed about collecting the bonus.
- Parameters
-
[in] | objectInfo | information about the picked bonus |
◆ calcGhostSpeed()
float CGameInfo::calcGhostSpeed |
( |
| ) |
const |
Method calc's ghost speed.
- Returns
- distance ghost can travel during one move (distance is measured as one between two tiles)
◆ calcMovingBonusSpeed()
float CGameInfo::calcMovingBonusSpeed |
( |
| ) |
const |
Method calc's moving bonus speed.
- Returns
- distance moving bonus can travel during one move (distance is measured as one between two tiles)
◆ calcPlayerSpeed()
float CGameInfo::calcPlayerSpeed |
( |
| ) |
const |
Method calc's player speed.
- Returns
- distance player can travel during one move (distance is measured as one between two tiles)
◆ generateMovingBonus()
bool CGameInfo::generateMovingBonus |
( |
| ) |
|
Returns info if the moving bonus should be generated. When true, then moving bonus have to be generated.
- Returns
- if the moving bonus have to be generated
◆ getDisplayInfo()
void CGameInfo::getDisplayInfo |
( |
SDisplayInfo & |
toFill | ) |
const |
Method fills info about the game.
- Parameters
-
[out] | toFill | structure where the information about the game which should be displayed will be saved |
◆ getGameState()
EGameState CGameInfo::getGameState |
( |
| ) |
const |
Returns current game state.
- Returns
- State of the game is returned.
◆ getPickedBonusesRatio()
float CGameInfo::getPickedBonusesRatio |
( |
| ) |
const |
Returns (already picked bonuses) / (bonuses on the beginning of the game)
- Returns
- value between 0 - 1
◆ getTime()
uint32_t CGameInfo::getTime |
( |
| ) |
const |
Returns current time in the game info.
- Returns
- time from the start of the game
◆ updateTime()
void CGameInfo::updateTime |
( |
uint32_t |
time | ) |
|
Updates timer in the game info.
- Parameters
-
[in] | time | time from the start of the game |
The documentation for this class was generated from the following files:
- krizpav6/src/game/CGameInfo.h
- krizpav6/src/game/CGameInfo.cpp