Public Member Functions | Protected Attributes | List of all members
terminus::World Class Reference

The World class represents a running game instance and contains all graphical (3D) elements of the scene. More...

#include <world.h>

Inheritance diagram for terminus::World:

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...
Worldoperator= (const World &other)=delete
 Delete assignment operator. More...
 ~World ()
void update ()
void render (QOpenGLFunctions &gl) const
LocalPlayerlocalPlayer ()
AbstractPlayerenemyPlayer ()
TrainlocalPlayerTrain ()
TrainenemyPlayerTrain ()
Levellevel ()
Timertimer ()
NetworkManagernetworkManager ()
LightManagerlightManager ()
void scheduleAction (ActionScheduler::Action event)
void addObject (AbstractGraphicsObject *node)
void deleteObject (AbstractGraphicsObject *object)
std::shared_ptr< BulletWorldbulletWorld ()
 Returns a shared pointer to the corresponding BulletWorld. More...

Protected Attributes

Level m_level
LightManager m_lightManager
std::shared_ptr< BulletWorldm_bulletWorld
std::unique_ptr< SkyBoxm_skybox
std::unique_ptr< Terrainm_terrain
std::shared_ptr< Trainm_rightTrain
std::shared_ptr< Trainm_leftTrain
std::unique_ptr< LocalPlayerm_localPlayer
std::unique_ptr< AbstractPlayerm_enemyPlayer
std::list< std::unique_ptr< AbstractGraphicsObject > > m_dynamicObjects

Detailed Description

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.

Constructor & Destructor Documentation

terminus::World::World ( Game game,
bool  isNetworkGame,
bool  isPlayerOne,
unsigned int  terrainSeed 

Construct a world for a local or multiplayer game.

gameReference to a game instance
isNetworkGameWhether this game is a network game or a local singleplayer game (with enemy AI)
isPlayerOneWhether the local player is "player one" or "player two"
terrainSeedSeed value for the noise generator to synchronize the terrain with the other network player
terminus::World::World ( const World other)

Delete copy constructor.

terminus::World::~World ( )

Member Function Documentation

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 ( )
World& terminus::World::operator= ( const World other)

Delete assignment operator.

void terminus::World::render ( QOpenGLFunctions &  gl) const
void terminus::World::scheduleAction ( ActionScheduler::Action  event)
Timer & terminus::World::timer ( )
void terminus::World::update ( )

Member Data Documentation

std::shared_ptr<BulletWorld> terminus::World::m_bulletWorld
std::list<std::unique_ptr<AbstractGraphicsObject> > terminus::World::m_dynamicObjects
std::unique_ptr<AbstractPlayer> terminus::World::m_enemyPlayer
Game& terminus::World::m_game
std::shared_ptr<Train> terminus::World::m_leftTrain
Level terminus::World::m_level
LightManager terminus::World::m_lightManager
std::unique_ptr<LocalPlayer> terminus::World::m_localPlayer
std::shared_ptr<Train> terminus::World::m_rightTrain
std::unique_ptr<SkyBox> terminus::World::m_skybox
std::unique_ptr<Terrain> terminus::World::m_terrain

The documentation for this class was generated from the following files: