1 #ifndef EVENTMANAGER_H_
2 #define EVENTMANAGER_H_
8 #include "../Objects/Map.h"
9 #include "../Objects/Player.h"
66 int RegisterEcho(std::vector<std::function<
void(std::string, std::string)>> functions);
84 int RegisterEndMatch(std::vector<std::function<
void(std::vector<PlayerRanking>,
int)>> functions);
147 int RegisterBillUpdated(std::vector<std::function<
void(
int,
int, std::string,
int)>> functions);
174 int RegisterVoteUpdated(std::vector<std::function<
void(std::string, std::string, std::string, std::string)>> functions);
214 void CallEcho(std::string
internal, std::string publicEcho);
227 void CallEndMatch(std::vector<PlayerRanking> rankings,
int winnerTeam);
284 void CallBillUpdated(
int billId,
int state, std::string stateName,
int transactionId);
310 void CallVoteUpdated(std::string stateName, std::string login, std::string commandName, std::string commandParam);
317 std::vector<std::function<void(std::string, std::string)>>
methodsEcho;
329 std::vector<std::function<void(std::string, std::string, std::string, std::string)>>
methodsVoteUpdated;
332 #endif // EVENTMANAGER_H_
std::vector< std::function< void(Player)> > methodsPlayerConnect
Vector with functions for the PlayerConnect event.
Definition: EventManager.h:313
void CallMapListModified(int currentMap, int nextMap, bool listModified)
Calls all functions which are subscribed to the MapListModified event.
Definition: EventManager.cpp:337
void CallBeginMap(Map map)
Calls all functions which are subscribed to the EndMatch event.
Definition: EventManager.cpp:274
int RegisterBeginMatch(std::vector< std::function< void()>> functions)
Register functions for the BeginMatch callback.
Definition: EventManager.cpp:79
int RegisterMapListModified(std::vector< std::function< void(int, int, bool)>> functions)
Register functions for the MapListModified callback.
Definition: EventManager.cpp:178
int RegisterEndMap(std::vector< std::function< void(Map)>> functions)
Register functions for the EndMap callback.
Definition: EventManager.cpp:112
std::vector< std::function< void(Player, std::string)> > methodsPlayerChat
Vector with functions for the PlayerChat event.
Definition: EventManager.h:315
void CallPlayerManialinkPageAnswer(Player player, std::string answer, std::vector< EntryVal > entries)
Calls all functions which are subscribed to the PlayerManialinkPageAnswer event.
Definition: EventManager.cpp:238
void CallStatusChanged(int statusCode, std::string statusName)
Calls all functions which are subscribed to the StatusChanged event.
Definition: EventManager.cpp:292
EventManager()
Definition: EventManager.cpp:3
int RegisterPlayerIncoherence(std::vector< std::function< void(Player)>> functions)
Register functions for the PlayerIncoherence callback.
Definition: EventManager.cpp:156
Contains all information about a player in easy-to-use format.
Definition: Player.h:10
std::vector< std::function< void()> > methodsBeginMatch
Vector with functions for the BeginMatch event.
Definition: EventManager.h:318
void CallPlayerFinish(Player player, int time)
Calls all functions which are subscribed to the PlayerFinish event.
Definition: EventManager.cpp:310
int RegisterEcho(std::vector< std::function< void(std::string, std::string)>> functions)
Register functions for the Echo callback.
Definition: EventManager.cpp:68
int RegisterPlayerConnect(std::vector< std::function< void(Player)>> functions)
Register functions for the PlayerConnect callback.
Definition: EventManager.cpp:24
int RegisterStatusChanged(std::vector< std::function< void(int, std::string)>> functions)
Register functions for the StatusChanged callback.
Definition: EventManager.cpp:123
std::vector< std::function< void(Player)> > methodsPlayerIncoherence
Vector with functions for the PlayerIncoherence event.
Definition: EventManager.h:325
std::vector< std::function< void(int, int, std::string, int)> > methodsBillUpdated
Vector with functions for the BillUpdated event.
Definition: EventManager.h:326
void CallPlayerConnect(Player player)
Calls all functions which are subscribed to the PlayerConnect event.
Definition: EventManager.cpp:211
std::vector< std::function< void(Player, std::string, std::vector< EntryVal >)> > methodsPlayerManialinkPageAnswer
Vector with functions for the PlayerManialinkPageAnswer event.
Definition: EventManager.h:316
void CallPlayerCheckpoint(Player player, int time, int currentLap, int checkpointIndex)
Calls all functions which are subscribed to the PlayerCheckpoint event.
Definition: EventManager.cpp:301
std::vector< std::function< void(Player)> > methodsPlayerDisconnect
Vector with functions for the PlayerDisconnect event.
Definition: EventManager.h:314
std::vector< std::function< void(std::string, std::string)> > methodsEcho
Vector with functions for the Echo event.
Definition: EventManager.h:317
Contains all information about a map in easy-to-use format.
Definition: Map.h:10
void CallBeginMatch()
Calls all functions which are subscribed to the BeginMatch event.
Definition: EventManager.cpp:256
int RegisterPlayerDisconnect(std::vector< std::function< void(Player)>> functions)
Register functions for the PlayerDisconnect callback.
Definition: EventManager.cpp:35
int RegisterPlayerManialinkPageAnswer(std::vector< std::function< void(Player, std::string, std::vector< EntryVal >)>> functions)
Register functions for the PlayerManialinkPageAnswer callback.
Definition: EventManager.cpp:57
std::vector< std::function< void(Player, int, int, int)> > methodsPlayerCheckpoint
Vector with functions for the PlayerCheckpoint event.
Definition: EventManager.h:323
void CallVoteUpdated(std::string stateName, std::string login, std::string commandName, std::string commandParam)
Calls all functions which are subscribed to the VoteUpdated event.
Definition: EventManager.cpp:355
void CallPlayerInfoChanged(Player player)
Calls all functions which are subscribed to the PlayerInfoChanged event.
Definition: EventManager.cpp:346
std::vector< std::function< void(Player, int)> > methodsPlayerFinish
Vector with functions for the PlayerFinish event.
Definition: EventManager.h:324
std::vector< std::function< void(std::vector< PlayerRanking >, int)> > methodsEndMatch
Vector with functions for the EndMatch event.
Definition: EventManager.h:319
std::vector< std::function< void(int, int, bool)> > methodsMapListModified
Vector with functions for the MapListModified event.
Definition: EventManager.h:327
std::vector< std::function< void(Player)> > methodsPlayerInfoChanged
Vector with functions for the PlayerInfoChanged event.
Definition: EventManager.h:328
int RegisterBeginMap(std::vector< std::function< void(Map)>> functions)
Register functions for the BeginMap callback.
Definition: EventManager.cpp:101
void CallEndMap(Map map)
Calls all functions which are subscribed to the EndMap event.
Definition: EventManager.cpp:283
std::vector< std::function< void(std::string, std::string, std::string, std::string)> > methodsVoteUpdated
Vector with functions for the VoteUpdated event.
Definition: EventManager.h:329
int RegisterPlayerCheckpoint(std::vector< std::function< void(Player, int, int, int)>> functions)
Register functions for the PlayerCheckpoint callback.
Definition: EventManager.cpp:134
int RegisterPlayerInfoChanged(std::vector< std::function< void(Player)>> functions)
Register functions for the PlayerInfoChanged callback.
Definition: EventManager.cpp:189
int RegisterEndMatch(std::vector< std::function< void(std::vector< PlayerRanking >, int)>> functions)
Register functions for the EndMatch callback.
Definition: EventManager.cpp:90
std::vector< std::function< void(Map)> > methodsBeginMap
Vector with functions for the BeginMap event.
Definition: EventManager.h:320
void CallPlayerDisconnect(Player player)
Calls all functions which are subscribed to the PlayerDisconnect event.
Definition: EventManager.cpp:220
int RegisterBillUpdated(std::vector< std::function< void(int, int, std::string, int)>> functions)
Register functions for the BillUpdated callback.
Definition: EventManager.cpp:167
std::vector< std::function< void(int, std::string)> > methodsStatusChanged
Vector with functions for the StatusChanged event.
Definition: EventManager.h:322
int RegisterPlayerChat(std::vector< std::function< void(Player, std::string)>> functions)
Register functions for the PlayerChat callback.
Definition: EventManager.cpp:46
std::vector< std::function< void(Map)> > methodsEndMap
Vector with functions for the EndMap event.
Definition: EventManager.h:321
void CallEcho(std::string internal, std::string publicEcho)
Calls all functions which are subscribed to the Echo event.
Definition: EventManager.cpp:247
void CallBillUpdated(int billId, int state, std::string stateName, int transactionId)
Calls all functions which are subscribed to the BillUpdated event.
Definition: EventManager.cpp:328
void CallPlayerChat(Player player, std::string text, bool isRegisteredCommand)
Calls all functions which are subscribed to the PlayerChat event.
Definition: EventManager.cpp:229
int RegisterVoteUpdated(std::vector< std::function< void(std::string, std::string, std::string, std::string)>> functions)
Register functions for the VoteUpdated callback.
Definition: EventManager.cpp:200
void CallPlayerIncoherence(Player player)
Calls all functions which are subscribed to the PlayerIncoherence event.
Definition: EventManager.cpp:319
void CallEndMatch(std::vector< PlayerRanking > rankings, int winnerTeam)
Calls all functions which are subscribed to the EndMatch event.
Definition: EventManager.cpp:265
Handles events (callbacks) from server to plugins.
Definition: EventManager.h:15
int RegisterPlayerFinish(std::vector< std::function< void(Player, int)>> functions)
Register functions for the PlayerFinish callback.
Definition: EventManager.cpp:145