granatier
Game Class Reference
#include <game.h>
Inheritance diagram for Game:
Public Slots | |
void | createBomb (Player *player, qreal x, qreal y, bool newBomb, int throwDistance) |
void | keyPressEvent (QKeyEvent *p_event) |
void | keyReleaseEvent (QKeyEvent *p_event) |
void | setRoundFinished () |
Signals | |
void | bombCreated (Bomb *bomb) |
void | bombRemoved (Bomb *bomb) |
void | gameOver () |
void | gameStarted () |
void | infoChanged (const Granatier::Info::Type p_info) |
void | pauseChanged (const bool p_pause, const bool p_fromUser) |
Public Member Functions | |
Game (PlayerSettings *playerSettings) | |
~Game () | |
void | blockDestroyed (const int row, const int col, Block *block) |
void | createBonus () |
Arena * | getArena () const |
QList< Bonus * > | getBonus () const |
bool | getGameOver () const |
QList< Player * > | getPlayers () const |
int | getRemainingTime () const |
QTimer * | getTimer () const |
QString | getWinner () const |
int | getWinPoints () const |
bool | isPaused () const |
void | pause (bool p_locked=false) |
void | removeBomb (Bomb *bomb) |
void | removeBonus (Bonus *bonus) |
void | setGameScene (GameScene *p_gameScene) |
void | setSoundsEnabled (bool p_enabled) |
void | start () |
void | switchPause () |
Detailed Description
This class manages the game main loop : it regularly checks the key press events, computes the character moves and updates their coordinates.
Constructor & Destructor Documentation
Game::Game | ( | PlayerSettings * | playerSettings | ) |
Member Function Documentation
void Game::blockDestroyed | ( | const int | row, |
const int | col, | ||
Block * | block | ||
) |
|
signal |
Emitted when a bomb was created.
|
signal |
Emitted when a bomb was removed.
|
slot |
Creates a bomb in the Cell with the coordinates x and y or throws the bomb from that possition if the player has the throw bonus.
- Parameters
-
player the player who dropped the bomb x the x-position where to put the bomb y the x-position where to put the bomb newBomb flag if a new bomb can be created or if only throwing is possible throwDistance the throw distance if the player has the throw bonus and the bomb shall be thrown
|
signal |
Emitted when the Game is over.
|
signal |
Emitted when the Game is started.
QList< Bonus * > Game::getBonus | ( | ) | const |
bool Game::getGameOver | ( | ) | const |
QList< Player * > Game::getPlayers | ( | ) | const |
int Game::getRemainingTime | ( | ) | const |
QString Game::getWinner | ( | ) | const |
int Game::getWinPoints | ( | ) | const |
|
signal |
Emitted when something to display has changed.
bool Game::isPaused | ( | ) | const |
|
slot |
|
slot |
void Game::pause | ( | bool | p_locked = false | ) |
|
signal |
void Game::removeBomb | ( | Bomb * | bomb | ) |
void Game::removeBonus | ( | Bonus * | bonus | ) |
void Game::setGameScene | ( | GameScene * | p_gameScene | ) |
|
slot |
void Game::setSoundsEnabled | ( | bool | p_enabled | ) |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.