Mania++
 All Classes Functions Variables Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Plugin Class Referenceabstract

Plugin interface, inherited by all plugins. More...

#include <Plugin.h>

Public Member Functions

virtual void Init ()=0
 Initializes plugin (called after loading all plugins).
 
void SetController (Controller *controllerPtr)
 Sets the controller instance. More...
 

Public Attributes

std::map< std::string,
std::string > 
Settings
 Plugin settings (from the config file).
 
std::vector< std::function
< void(Player)> > 
PlayerConnect
 Vector with functions for the PlayerConnect event.
 
std::vector< std::function
< void(Player)> > 
PlayerDisconnect
 Vector with functions for the PlayerDisconnect event.
 
std::vector< std::function
< void(Player, std::string)> > 
PlayerChat
 Vector with functions for the PlayerChat event.
 
std::vector< std::function
< void(std::string,
std::string)> > 
Echo
 Vector with functions for the Echo event.
 
std::vector< std::function
< void()> > 
BeginMatch
 Vector with functions for the BeginMatch event.
 
std::vector< std::function
< void(std::vector
< PlayerRanking >, int)> > 
EndMatch
 Vector with functions for the EndMatch event.
 
std::vector< std::function
< void(Map)> > 
BeginMap
 Vector with functions for the BeginMap event.
 
std::vector< std::function
< void(Map)> > 
EndMap
 Vector with functions for the EndMap event.
 
std::vector< std::function
< void(int, std::string)> > 
StatusChanged
 Vector with functions for the StatusChanged event.
 
std::vector< std::function
< void(Player, int, int, int)> > 
PlayerCheckpoint
 Vector with functions for the PlayerCheckpoint event.
 
std::vector< std::function
< void(Player, int)> > 
PlayerFinish
 Vector with functions for the PlayerFinish event.
 
std::vector< std::function
< void(Player)> > 
PlayerIncoherence
 Vector with functions for the PlayerIncoherence event.
 
std::vector< std::function
< void(int, int, std::string,
int)> > 
BillUpdated
 Vector with functions for the BillUpdated event.
 
std::vector< std::function
< void(int, int, bool)> > 
MapListModified
 Vector with functions for the MapListModified event.
 
std::vector< std::function
< void(Player)> > 
PlayerInfoChanged
 Vector with functions for the PlayerInfoChanged event.
 
std::vector< std::function
< void(std::string,
std::string, std::string,
std::string)> > 
VoteUpdated
 Vector with functions for the VoteUpdated event.
 
std::map< std::string,
std::function< void(Player,
std::vector< std::string >)> > 
Commands
 Map with normal chat commands for the plugin. More...
 
std::map< std::string,
std::function< void(Player,
std::vector< std::string >)> > 
AdminCommands
 Map with admin chat commands for the plugin. More...
 
std::string Version
 Plugin version.
 
std::string Author
 Plugin author.
 

Protected Member Functions

void RegisterCommand (std::string name, std::function< void(Player, std::vector< std::string >)> method)
 Register chat command. More...
 
void RegisterAdminCommand (std::string name, std::function< void(Player, std::vector< std::string >)> method)
 Register admin chat command. More...
 

Protected Attributes

Controllercontroller
 Struct with needed instances.
 

Detailed Description

Plugin interface, inherited by all plugins.

Member Function Documentation

void Plugin::RegisterAdminCommand ( std::string  name,
std::function< void(Player, std::vector< std::string >)>  method 
)
inlineprotected

Register admin chat command.

Parameters
nameAdmin chat command name.
methodMethod to be called for the command.
void Plugin::RegisterCommand ( std::string  name,
std::function< void(Player, std::vector< std::string >)>  method 
)
inlineprotected

Register chat command.

Parameters
nameChat command name.
methodMethod to be called for the command.
void Plugin::SetController ( Controller controllerPtr)
inline

Sets the controller instance.

Parameters
controllerPtrPointer to the controller instance.

Member Data Documentation

std::map<std::string, std::function<void(Player, std::vector<std::string>)> > Plugin::AdminCommands
Initial value:
=
std::map<std::string, std::function<void(Player, std::vector<std::string>)>>()

Map with admin chat commands for the plugin.

std::map<std::string, std::function<void(Player, std::vector<std::string>)> > Plugin::Commands
Initial value:
=
std::map<std::string, std::function<void(Player, std::vector<std::string>)>>()

Map with normal chat commands for the plugin.


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