Terminus
|
The World class represents a running game instance and contains all graphical (3D) elements of the scene. More...
#include <world.h>
Public Member Functions | |
World (Game &game, bool isNetworkGame, bool isPlayerOne, unsigned int terrainSeed) | |
Construct a world for a local or multiplayer game. More... | |
World (const World &other)=delete | |
Delete copy constructor. More... | |
World & | operator= (const World &other)=delete |
Delete assignment operator. More... | |
~World () | |
void | update () |
void | render (QOpenGLFunctions &gl) const |
LocalPlayer & | localPlayer () |
AbstractPlayer & | enemyPlayer () |
Train & | localPlayerTrain () |
Train & | enemyPlayerTrain () |
Level & | level () |
Timer & | timer () |
NetworkManager & | networkManager () |
LightManager & | lightManager () |
void | scheduleAction (ActionScheduler::Action event) |
void | addObject (AbstractGraphicsObject *node) |
void | deleteObject (AbstractGraphicsObject *object) |
std::shared_ptr< BulletWorld > | bulletWorld () |
Returns a shared pointer to the corresponding BulletWorld. More... | |
Protected Attributes | |
Game & | m_game |
Level | m_level |
LightManager | m_lightManager |
std::shared_ptr< BulletWorld > | m_bulletWorld |
std::unique_ptr< SkyBox > | m_skybox |
std::unique_ptr< Terrain > | m_terrain |
std::shared_ptr< Train > | m_rightTrain |
std::shared_ptr< Train > | m_leftTrain |
std::unique_ptr< LocalPlayer > | m_localPlayer |
std::unique_ptr< AbstractPlayer > | m_enemyPlayer |
std::list< std::unique_ptr< AbstractGraphicsObject > > | m_dynamicObjects |
The World class represents a running game instance and contains all graphical (3D) elements of the scene.
A running game consists of a Terrain, two Train instances, other graphical elements (Projectile, Skybox, ...) and two AbstractPlayer s controlling the two trains. It also holds the BulletWorld, an encapsulation of all bullet-related classes and methods.
terminus::World::World | ( | Game & | game, |
bool | isNetworkGame, | ||
bool | isPlayerOne, | ||
unsigned int | terrainSeed | ||
) |
Construct a world for a local or multiplayer game.
game | Reference to a game instance |
isNetworkGame | Whether this game is a network game or a local singleplayer game (with enemy AI) |
isPlayerOne | Whether the local player is "player one" or "player two" |
terrainSeed | Seed value for the noise generator to synchronize the terrain with the other network player |
|
delete |
Delete copy constructor.
terminus::World::~World | ( | ) |
void terminus::World::addObject | ( | AbstractGraphicsObject * | node | ) |
std::shared_ptr< BulletWorld > terminus::World::bulletWorld | ( | ) |
Returns a shared pointer to the corresponding BulletWorld.
This getter is mainly used in the constructor of AbstractPhysicsObject. AbstractPhysicsObjects that need to operate on the BulletWorld should not call it via this getter, but use their own stored copy.
void terminus::World::deleteObject | ( | AbstractGraphicsObject * | object | ) |
AbstractPlayer & terminus::World::enemyPlayer | ( | ) |
Train & terminus::World::enemyPlayerTrain | ( | ) |
Level & terminus::World::level | ( | ) |
LightManager & terminus::World::lightManager | ( | ) |
LocalPlayer & terminus::World::localPlayer | ( | ) |
Train & terminus::World::localPlayerTrain | ( | ) |
NetworkManager & terminus::World::networkManager | ( | ) |
void terminus::World::render | ( | QOpenGLFunctions & | gl | ) | const |
void terminus::World::scheduleAction | ( | ActionScheduler::Action | event | ) |
Timer & terminus::World::timer | ( | ) |
void terminus::World::update | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |