Emergency 20 Dokumentation  4.2.0
em5::Plugin Class Reference

EMERGENCY 5 plugin implementation. More...

#include <Plugin.h>

Inheritance diagram for em5::Plugin:
qsf::Plugin qsf::SystemContainer

Public Member Functions

 Plugin ()
 Default constructor. More...
 
virtual ~Plugin ()
 Destructor. More...
 
ModSystemgetModSystem () const
 Return the mod system instance. More...
 
FreeplaySystemgetFreeplaySystem () const
 Return the freeplay system instance. More...
 
HealthSystemgetHealthSystem () const
 Return the health system instance. More...
 
FireSystemgetFireSystem () const
 Return the fire system instance. More...
 
ActivitySystemgetActivitySystem () const
 Return the activity system instance. More...
 
qsf::game::AchievementSystemgetAchievementSystem () const
 Return the achievement system instance. More...
 
virtual const char * getName () const override
 Return the name of the plugin. More...
 
virtual const char * getVendor () const override
 Return the vendor of the plugin. More...
 
virtual const char * getDescription () const override
 Return the description of the plugin. More...
 
virtual const char * getSystemContainerName () const override
 
- Public Member Functions inherited from qsf::Plugin
const std::string & getFilename () const
 Return the filename of the file this plugin is in. More...
 
const std::vector< const camp::Class * > & getCampClasses () const
 Return the list of CAMP metaclasses registered by this plugin. More...
 
const PluginVersionBasegetPluginVersion () const
 Return plugin version information. More...
 
std::string getPluginVersionString () const
 Return the version string of the plugin. More...
 
- Public Member Functions inherited from qsf::SystemContainer
 SystemContainer ()
 Default constructor. More...
 
virtual ~SystemContainer ()
 Destructor. More...
 
bool startupSystems (bool serverMode)
 Startup all registered systems in the order of registeration. More...
 
void shutdownSystems ()
 Shutdown all registered systems in reverse registration order. More...
 
const std::vector< System * > & getSystems () const
 Return the list of systems. More...
 

Static Public Member Functions

static Plugininstance ()
 Return the global EMERGENCY 5 plugin instance. More...
 
static PlugingetInstanceSafe ()
 Return the global EMERGENCY 5 plugin instance; throws an exception when it is not initialized. More...
 

Protected Member Functions

virtual bool onInstall () override
 Install the plugin. More...
 
virtual bool onStartup () override
 Startup EMERGENCY 5 plugin. More...
 
virtual void onShutdown () override
 Shutdown EMERGENCY 5 plugin. More...
 
virtual void onUninstall () override
 Uninstall the plugin. More...
 
- Protected Member Functions inherited from qsf::Plugin
 Plugin (PluginVersionBase *pluginVersion)
 Constructor. More...
 
void addCampClass (const camp::Class &campClass)
 Add a CAMP class registered by this plugin. More...
 
- Protected Member Functions inherited from qsf::SystemContainer
virtual void logSystemMessage (const std::string &message)
 
template<typename T >
T * createAndInsertSystem ()
 

Additional Inherited Members

- Protected Attributes inherited from qsf::SystemContainer
std::vector< System * > mSystems
 The systems, do not destroy the instances. More...
 

Detailed Description

EMERGENCY 5 plugin implementation.

Constructor & Destructor Documentation

em5::Plugin::Plugin ( )

Default constructor.

virtual em5::Plugin::~Plugin ( )
virtual

Destructor.

Reimplemented from qsf::Plugin.

Member Function Documentation

qsf::game::AchievementSystem & em5::Plugin::getAchievementSystem ( ) const
inline

Return the achievement system instance.

Returns
The achievement system instance, do no destroy the returned instance
ActivitySystem & em5::Plugin::getActivitySystem ( ) const
inline

Return the activity system instance.

Returns
The activity system instance, do no destroy the returned instance
const char * em5::Plugin::getDescription ( ) const
inlineoverridevirtual

Return the description of the plugin.

Returns
The null terminated ASCII description of the plugin, never a null pointer, do not free the returned memory

Implements qsf::Plugin.

FireSystem & em5::Plugin::getFireSystem ( ) const
inline

Return the fire system instance.

Returns
The fire system instance, do no destroy the returned instance
FreeplaySystem & em5::Plugin::getFreeplaySystem ( ) const
inline

Return the freeplay system instance.

Returns
The freeplay system instance, do no destroy the returned instance
HealthSystem & em5::Plugin::getHealthSystem ( ) const
inline

Return the health system instance.

Returns
The health system instance, do no destroy the returned instance
Plugin & em5::Plugin::getInstanceSafe ( )
inlinestatic

Return the global EMERGENCY 5 plugin instance; throws an exception when it is not initialized.

ModSystem & em5::Plugin::getModSystem ( ) const
inline

Return the mod system instance.

Returns
The mod system instance, do no destroy the returned instance
const char * em5::Plugin::getName ( ) const
inlineoverridevirtual

Return the name of the plugin.

Returns
The null terminated ASCII name of the plugin, never a null pointer, do not free the returned memory

Implements qsf::Plugin.

const char * em5::Plugin::getSystemContainerName ( ) const
inlineoverridevirtual

Implements qsf::SystemContainer.

const char * em5::Plugin::getVendor ( ) const
inlineoverridevirtual

Return the vendor of the plugin.

Returns
The null terminated ASCII vendor of the plugin, never a null pointer, do not free the returned memory

Implements qsf::Plugin.

Plugin * em5::Plugin::instance ( )
inlinestatic

Return the global EMERGENCY 5 plugin instance.

Returns
The global EMERGENCY 5 plugin instance, null pointer in case there's no such global instance, do no destroy the returned instance
Remarks
This EMERGENCY 5 plugin class plays a central role and therefore we decided to make it to a singleton. The approach is the same as the one used by Qt's "QCoreApplication::instance()".
virtual bool em5::Plugin::onInstall ( )
overrideprotectedvirtual

Install the plugin.

Returns
"true" if all went fine, else "false"

Implements qsf::Plugin.

virtual void em5::Plugin::onShutdown ( )
overrideprotectedvirtual

Shutdown EMERGENCY 5 plugin.

Remarks
The implementation does the following tasks:
  • Shutdown the Fire system ("em5::FireSystem::onShutdown()")
  • Shutdown the Health system ("em5::HealthSystem::onShutdown()")
  • Shutdown the Freeplay system ("em5::FreeplaySystem::onShutdown()")
  • Shutdown the Achievement system ("qsf::game::AchievementSystem::onShutdown()")
Note
  • Do only call this method in case "startup()" returned successfully

Implements qsf::Plugin.

virtual bool em5::Plugin::onStartup ( )
overrideprotectedvirtual

Startup EMERGENCY 5 plugin.

Returns
"true" if all went fine, else "false"
Remarks
The implementation does the following tasks:
  • Startup the Freeplay system ("em5::FreeplaySystem::onStartup()")
  • Startup the Health system ("em5::HealthSystem::onStartup()")
  • Startup the Fire system ("em5::FireSystem::onStartup()")
  • Startup the Achievement system ("qsf::game::AchievementSystem::onStartup()")

Implements qsf::Plugin.

virtual void em5::Plugin::onUninstall ( )
overrideprotectedvirtual

Uninstall the plugin.

Note
  • Only called in case "onInstall()" returned successfully

Implements qsf::Plugin.


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