![]() |
Castle Battle
1.0
|
GameManager is the main manager of the gameplay. More...
#include <gamemanager.h>
Public Member Functions | |
GameManager (scene::ISceneManager *smgr, video::IVideoDriver *driver, IrrlichtDevice *device, core::vector3df worldPosition, Physics *physics, core::stringw *names=0) | |
Default constructor. More... | |
~GameManager () | |
void | initGamePlay (core::stringw *names=0) |
Create players and start gameplay. More... | |
bool | loop () |
Main Gameplay loop. More... | |
int | getWinner () |
Get the winner. More... | |
core::stringw * | getNames () |
Get player names. More... | |
Public Attributes | |
bool | stop |
If someone win, stop is set to true. More... | |
Private Member Functions | |
void | initKeyboard () |
Set the Irrlicht device event receiver with a Keyboard instance. More... | |
Private Attributes | |
scene::ISceneManager * | smgr |
video::IVideoDriver * | driver |
IrrlichtDevice * | device |
Physics * | physics |
Player * | players [2] |
Array of players. More... | |
bool | turn |
Turn to play: true: first player, false second player. More... | |
core::vector3df | worldPosition |
World initial position, by default is setted to Terrain center. More... | |
HUD::HUD * | hud |
HUD of the gameplay. More... | |
Keyboard | keyboard |
The keyboard map of each players. More... | |
core::stringw * | names |
Player names. More... | |
GameManager is the main manager of the gameplay.
It will create the players, castle, cannons and will start the loop of the gameplay.
GameManager::GameManager | ( | scene::ISceneManager * | smgr, |
video::IVideoDriver * | driver, | ||
IrrlichtDevice * | device, | ||
core::vector3df | worldPosition, | ||
Physics * | physics, | ||
core::stringw * | names = 0 |
||
) |
Default constructor.
Given players names, and Application Irrlicht and Physics instances, this will create players, castle, mapping keyboard and start the gameplay.
Irrlicht | instances and Physic instance |
names | stringw array of names. Optional. If no specified Player1 and Player2 will be the names. |
core::stringw * GameManager::getNames | ( | ) |
Get player names.
int GameManager::getWinner | ( | ) |
Get the winner.
void GameManager::initGamePlay | ( | core::stringw * | names = 0 | ) |
Create players and start gameplay.
|
private |
Set the Irrlicht device event receiver with a Keyboard instance.
bool GameManager::loop | ( | ) |
Main Gameplay loop.
The Application main loop is propagate here. This loop is propagate to Player::loop()
|
private |
|
private |
|
private |
|
private |
The keyboard map of each players.
For now all players will have same Keyboard map
|
private |
Player names.
|
private |
|
private |
Array of players.
|
private |
bool GameManager::stop |
If someone win, stop is set to true.
|
private |
Turn to play: true: first player, false second player.
|
private |
World initial position, by default is setted to Terrain center.