Module
|
#include <ModuleGame.hpp>
Public Member Functions | |
ModuleGame () | |
void | attachGraphicsInterface (GraphicsInterface *newGraphics) |
void | attachAudioInterface (AudioInterface *newAudio) |
void | attachThreadingInterface (ThreadingInterface *newThreading) |
void | startThread (ThreadObject *obj) |
void | start () |
bool | isRunning () |
GameObject * | createGameObject () |
Book< GameObject >::size_type | numObjects () const |
GameObject * | getGameObject (Book< GameObject >::size_type index) |
const GameObject * | getGameObject (Book< GameObject >::size_type index) const |
Mutex * | createMutex () |
void | setMesh (GameObject *obj, Mesh *mesh) |
unsigned long | getMilliseconds () |
The main class of Module. The ModuleGame class represents the core of Module. Its functionality ties together that of the different interfaces. End users of Module (game developers) control Module through this class and not by accessing interfaces, as those are meant to be abstracted away from users. Setting up a ModuleGame instance should be the first thing done in a game that uses Module.
Module::ModuleGame::ModuleGame | ( | ) |
The default constructor of ModuleGame.
void Module::ModuleGame::attachAudioInterface | ( | AudioInterface * | newAudio | ) |
Attaches an AudioInterface to this game.
newAudio | A pointer to the AudioInterface to attach to this game |
void Module::ModuleGame::attachGraphicsInterface | ( | GraphicsInterface * | newGraphics | ) |
Attaches a GraphicsInterface to this game.
newGraphics | A pointer to the GraphicsInterface to attach to this game |
void Module::ModuleGame::attachThreadingInterface | ( | ThreadingInterface * | newThreading | ) |
Attaches a ThreadingInterface to this game.
newThreading | A pointer to the ThreadingInterface to attach to this game |
Module::GameObject * Module::ModuleGame::createGameObject | ( | ) |
Creates a new GameObject.
|
inline |
|
inline |
|
inline |
|
inline |
bool Module::ModuleGame::isRunning | ( | ) |
Checks if the game is running or not.
|
inline |
|
inline |
Sets the Mesh component of a GameObject
obj | The GameObject to set the Mesh component of |
mesh | The corresponding Mesh |
void Module::ModuleGame::start | ( | ) |
Starts the game.
void Module::ModuleGame::startThread | ( | ThreadObject * | obj | ) |
Calls the run function of a ThreadObject in a newly spawned thread.
obj | The ThreadObject to call the run method of |