Emergency 20 Dokumentation  4.2.0
em5::FreeplaySystem Class Reference

EMERGENCY 5 freeplay system. More...

#include <FreeplaySystem.h>

Inheritance diagram for em5::FreeplaySystem:
qsf::System

Public Types

typedef std::vector< std::string > EventPoolArray
 
typedef std::unordered_map< std::string, std::string > GameModeClassNameMapping
 

Public Member Functions

 FreeplaySystem ()
 Default constructor. More...
 
virtual ~FreeplaySystem ()
 Destructor. More...
 
void loadEventPoolAssets ()
 Load freeplay event pool assets (in case you want to do it before the startup already) More...
 
void startupFreeplay ()
 Initialize and start a new freeplay. More...
 
void shutdownFreeplay ()
 Shutdown the current freeplay. More...
 
void updateFreeplay (const qsf::Time &timePassed)
 Update the running freeplay. More...
 
GameModeClassNameMappinggetGameModeClassNameMapping ()
 Return the game mode class name mapping. More...
 
GameModegetGameMode () const
 Return the game mode instance, which can be a null pointer. More...
 
void sendGameModeSignal (const std::string &gameModeSignal)
 Send a signal to the game mode instance, if there is one. More...
 
FreeplayEventManagergetEventManager () const
 Get the freeplay event manager instance. More...
 
FreeplayEventFactoryManagergetFactoryManager () const
 Get the freeplay event factory manager instance. More...
 
FreeplayEventGeneratorgetEventGenerator () const
 Get the freeplay event generator instance. More...
 
FreeplayEventPoolManagergetEventPoolManager () const
 Get the freeplay event pool manager instance. More...
 
ObjectiveManagergetObjectiveManager () const
 Get the objective manager instance. More...
 
CleanupManagergetCleanupManager () const
 Get the density calculator instance. More...
 
DensityCalculatorgetDensityCalculator () const
 Get the density calculator instance. More...
 
void insertFreeplayEvent (FreeplayEvent &freeplayEvent)
 Insert a new freeplay event from outside. More...
 
FreeplayEventtriggerEventByPath (const std::string &eventPath, const FreeplayEventTriggerInfo &triggerInfo)
 Trigger an event by full path to the event. More...
 
void triggerLastEvent ()
 Trigger an event by using the factory from the last triggered event. More...
 
bool setEventPoolsByName (const std::string &poolsName)
 Clear current events in the system to set a new pool of events. More...
 
bool addEventPoolsByName (const std::string &poolsName)
 Add pool of events to the current events in the system. More...
 
bool removeEventPoolsByName (const std::string &poolsName)
 Removes pool of events from the current events in the system. More...
 
void onEventFinished (FreeplayEvent &freeplayEvent, FreeplayEvent::EventResult &eventResult)
 React to the finishing of an event. More...
 
void onObjectiveGetsPoints (FreeplayEvent &freeplayEvent, FreeplayEvent::ObjectiveResult &objectiveResult)
 
void onAbortEvent (FreeplayEvent &freeplayEvent)
 Break an current event. More...
 
void serialize (qsf::BinarySerializer &serializer)
 
virtual const char * getName () const override
 Get the name of the system. More...
 
virtual bool onStartup (bool serverMode) override
 Startup the system. More...
 
virtual void onShutdown () override
 Shutdown the system. More...
 
- Public Member Functions inherited from qsf::System
virtual ~System ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from qsf::System
 System ()
 Default constructor. More...
 

Detailed Description

EMERGENCY 5 freeplay system.

Member Typedef Documentation

typedef std::vector<std::string> em5::FreeplaySystem::EventPoolArray
typedef std::unordered_map<std::string, std::string> em5::FreeplaySystem::GameModeClassNameMapping

Constructor & Destructor Documentation

em5::FreeplaySystem::FreeplaySystem ( )

Default constructor.

virtual em5::FreeplaySystem::~FreeplaySystem ( )
virtual

Destructor.

Member Function Documentation

bool em5::FreeplaySystem::addEventPoolsByName ( const std::string &  poolsName)

Add pool of events to the current events in the system.

Parameters
[in]poolsNameA string filled with the keys of used event pools (separator: ",")
Returns
"True" when at least one event pool exists otherwise false
CleanupManager & em5::FreeplaySystem::getCleanupManager ( ) const
inline

Get the density calculator instance.

DensityCalculator & em5::FreeplaySystem::getDensityCalculator ( ) const
inline

Get the density calculator instance.

FreeplayEventGenerator & em5::FreeplaySystem::getEventGenerator ( ) const
inline

Get the freeplay event generator instance.

FreeplayEventManager & em5::FreeplaySystem::getEventManager ( ) const
inline

Get the freeplay event manager instance.

FreeplayEventPoolManager & em5::FreeplaySystem::getEventPoolManager ( ) const
inline

Get the freeplay event pool manager instance.

FreeplayEventFactoryManager & em5::FreeplaySystem::getFactoryManager ( ) const
inline

Get the freeplay event factory manager instance.

GameMode* em5::FreeplaySystem::getGameMode ( ) const

Return the game mode instance, which can be a null pointer.

GameModeClassNameMapping& em5::FreeplaySystem::getGameModeClassNameMapping ( )

Return the game mode class name mapping.

Note
  • EMERGENCY 5 modifications can use this to change e.g. "em5::MultiplayPvPGameMode" into "my::MyMultiplayGameMode" when creating the game mode instance
virtual const char* em5::FreeplaySystem::getName ( ) const
overridevirtual

Get the name of the system.

Returns
Null terminated ASCII name of the system, never a null pointer, do not manipulate or destroy the returned name

Implements qsf::System.

ObjectiveManager & em5::FreeplaySystem::getObjectiveManager ( ) const
inline

Get the objective manager instance.

void em5::FreeplaySystem::insertFreeplayEvent ( FreeplayEvent freeplayEvent)

Insert a new freeplay event from outside.

void em5::FreeplaySystem::loadEventPoolAssets ( )

Load freeplay event pool assets (in case you want to do it before the startup already)

void em5::FreeplaySystem::onAbortEvent ( FreeplayEvent freeplayEvent)

Break an current event.

void em5::FreeplaySystem::onEventFinished ( FreeplayEvent freeplayEvent,
FreeplayEvent::EventResult eventResult 
)

React to the finishing of an event.

void em5::FreeplaySystem::onObjectiveGetsPoints ( FreeplayEvent freeplayEvent,
FreeplayEvent::ObjectiveResult objectiveResult 
)
virtual void em5::FreeplaySystem::onShutdown ( )
overridevirtual

Shutdown the system.

Note
  • This method is only called case "onStartup()" returned successfully

Implements qsf::System.

virtual bool em5::FreeplaySystem::onStartup ( bool  serverMode)
overridevirtual

Startup the system.

Parameters
[in]serverMode"true" if the system should start in server mode, else "false"
Returns
"true" if all went fine, else "false"
Note
  • Server mode means that e.g. there's no need for audio & visual stuff because there's no display or sound hardware in the first place

Implements qsf::System.

bool em5::FreeplaySystem::removeEventPoolsByName ( const std::string &  poolsName)

Removes pool of events from the current events in the system.

Parameters
[in]poolsNameA string filled with the keys of used event pools (separator: ",")
Returns
"True" when at least one event pool exists otherwise false
void em5::FreeplaySystem::sendGameModeSignal ( const std::string &  gameModeSignal)

Send a signal to the game mode instance, if there is one.

void em5::FreeplaySystem::serialize ( qsf::BinarySerializer serializer)
bool em5::FreeplaySystem::setEventPoolsByName ( const std::string &  poolsName)

Clear current events in the system to set a new pool of events.

Parameters
[in]poolsNameA string filled with the keys of used event pools (separator: ",")
Returns
"True" when at least one event pool exists otherwise false
void em5::FreeplaySystem::shutdownFreeplay ( )

Shutdown the current freeplay.

void em5::FreeplaySystem::startupFreeplay ( )

Initialize and start a new freeplay.

FreeplayEvent* em5::FreeplaySystem::triggerEventByPath ( const std::string &  eventPath,
const FreeplayEventTriggerInfo triggerInfo 
)

Trigger an event by full path to the event.

Parameters
[in]eventPathThe event pool name and the event name divided by '/', e.g. "EM5_Simple_MedicalEmergency_Event_Definitions/HeartAttack"
Returns
The triggered freeplay event instance if the event could be triggered, null pointer if the event definition was not found or trigger conditions were not met
void em5::FreeplaySystem::triggerLastEvent ( )

Trigger an event by using the factory from the last triggered event.

void em5::FreeplaySystem::updateFreeplay ( const qsf::Time timePassed)

Update the running freeplay.


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