i6engine  1.0
i6e::api::Application Class Referenceabstract

Interface for the game developer. More...

#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/api/Application.h>

Public Member Functions

 Application ()
 
virtual ~Application ()
 
virtual void Initialize ()=0
 called on EngineStart More...
 
virtual void AfterInitialize ()=0
 called after finishing initialization More...
 
virtual void Tick ()=0
 called in every loop step More...
 
virtual bool ShutdownRequest ()=0
 called on EngineShutdown More...
 
virtual void Finalize ()=0
 called after everything is completely shutdown More...
 
std::string getName () const
 returns the name of the Application More...
 
void setName (const std::string &name)
 sets the name of the Application More...
 
virtual void disconnectCallback (const core::IPKey &)
 called when a player had a disconnect More...
 
virtual void connectionFailed (const core::IPKey &)
 called when connecting to server failes More...
 
virtual void bindFailure ()
 called when address or port is already in use while connecting to m2etis More...
 
virtual void connected (const core::IPKey &)
 called when connection request was handled More...
 
void ShutDown ()
 called from engine to signal shutdown More...
 
- Public Member Functions inherited from i6e::core::ModuleController
 ModuleController (Subsystem sub)
 Constructs a new ModuleController with the given subsystem type. More...
 
virtual ~ModuleController ()
 Destructor. More...
 
void startThreadTicking (const uint32_t lngFrameTime)
 Starts the thread synchronously of the subsystem and tells the SubSystemController about completion. More...
 
void startThreadWaiting (const std::set< Subsystem > &waitingFor)
 Starts the thread synchronously of the subsystem and tells the SubSystemController about completion. More...
 
uint32_t getFrameTime () const
 Gets the frametime of this Subsystem. More...
 
void setController (SubSystemController *ssc, EngineCoreController *ecc, MessagingController *mc)
 registers necessary controllers for this Subsystem More...
 
Subsystem getSubsystem () const
 
- Public Member Functions inherited from i6e::core::MessageSubscriber
 MessageSubscriber ()
 Standard constructor. More...
 
virtual ~MessageSubscriber ()
 Destructor. More...
 
void receiveMessage (const Message::Ptr &msg)
 This method is called from the MessagingController. It stores incoming messages in a local buffer. More...
 
void notifyNewID (const int64_t id)
 This method notifies the MessagingController that Messages waiting for this id can now be delivered. More...
 
void buffer (const ReceivedMessagePtr &msg)
 Calls deliverMessageInternal if the message should be delivered now, buffers it if not. More...
 
void reset ()
 todo More...
 
void addMethod (uint16_t msgType, const boost::function< void(const Message::Ptr &)> &ptrMessageMethod)
 adds a method for given message type where messages shall be delivered More...
 
void removeMethod (uint16_t msgType)
 removes method for given message type More...
 

Additional Inherited Members

- Protected Member Functions inherited from i6e::core::ModuleController
void processMessages () override
 override of processMessages of MessageSubscriber for waiting subsystems More...
 
- Protected Member Functions inherited from i6e::core::MessageSubscriber
void swapMessageBuffer ()
 This method will swap the double message buffer. For synchronization reasons. More...
 
bool updateBuffer ()
 This method delivers all waiting Messages that can now be delivered. More...
 
- Protected Attributes inherited from i6e::core::ModuleController
Subsystem _subsystem
 the Subsystem More...
 
uint32_t _frameTime
 the frame time of the Subsystem More...
 
MessagingController_messagingController
 pointer to MessagingController More...
 
- Protected Attributes inherited from i6e::core::MessageSubscriber
boost::mutex _objMessageVectorMutex
 
MessageVector _objMessageVectorA
 
MessageVector _objMessageVectorB
 
MessageVector_objActiveMessageVector
 
MessageVector_objInActiveMessageVector
 
std::map< uint16_t, boost::function< void(const Message::Ptr &)> > _ptrMessageMethod
 

Detailed Description

Interface for the game developer.

these functions are callbacks that are called by the Engine in appropriate situations derive from this class to get your main application Override all pure virtual methods and all virtual methods you need. You can safely assume, simply overriding won't cause problems, as the functions don't do anything by default.

Definition at line 50 of file Application.h.

Constructor & Destructor Documentation

i6e::api::Application::Application ( )
inline

Definition at line 52 of file Application.h.

virtual i6e::api::Application::~Application ( )
inlinevirtual

Definition at line 54 of file Application.h.

Member Function Documentation

virtual void i6e::api::Application::AfterInitialize ( )
pure virtual

called after finishing initialization

Now everthing is loaded, initialised and ready to be run You can do what ever you want now.

virtual void i6e::api::Application::bindFailure ( )
inlinevirtual

called when address or port is already in use while connecting to m2etis

Definition at line 127 of file Application.h.

virtual void i6e::api::Application::connected ( const core::IPKey )
inlinevirtual

called when connection request was handled

Parameters
[in]keyidentifying the user who joined

Definition at line 133 of file Application.h.

virtual void i6e::api::Application::connectionFailed ( const core::IPKey )
inlinevirtual

called when connecting to server failes

Definition at line 122 of file Application.h.

virtual void i6e::api::Application::disconnectCallback ( const core::IPKey )
inlinevirtual

called when a player had a disconnect

Parameters
[in]keykey identifying the player

Definition at line 117 of file Application.h.

virtual void i6e::api::Application::Finalize ( )
pure virtual

called after everything is completely shutdown

after returning from this function, the engine just returns.
here you can free all ressources before the game object is destroyed.

std::string i6e::api::Application::getName ( ) const
inline

returns the name of the Application

Returns
Name of the game

Definition at line 101 of file Application.h.

virtual void i6e::api::Application::Initialize ( )
pure virtual

called on EngineStart

In the current state, only the very basic objects are initialised. You probably don't want to do anything here

void i6e::api::Application::setName ( const std::string &  name)
inline

sets the name of the Application

Parameters
[in]namename that will be used as the window title

Definition at line 109 of file Application.h.

void i6e::api::Application::ShutDown ( )
inlinevirtual

called from engine to signal shutdown

Implements i6e::core::ModuleController.

Definition at line 138 of file Application.h.

virtual bool i6e::api::Application::ShutdownRequest ( )
pure virtual

called on EngineShutdown

This function is called just before the Engine starts shutting down.
In this state, the game is still entirely present, but frozen. Thus you have atomic access to the whole game. This function can be used for saving e.g., but keep in mind, the engine is paused. Messages, Timers etc. won't be processed.

virtual void i6e::api::Application::Tick ( )
pure virtual

called in every loop step

This function is called whenever the mainLoop starts from the beginning.
After returning from this function the world is updated and afterwards rendered.

Implements i6e::core::ModuleController.


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