summaryrefslogtreecommitdiffstats
path: root/src/Root.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-09-02 09:45:06 +0200
committerAlexander Harkness <me@bearbin.net>2017-09-02 09:50:23 +0200
commit49c443896dcac8c4eaf08c4024e8bd2366ad899a (patch)
treeb1ec46cab2b4e5731860c7136f1bbfca6fe9d458 /src/Root.h
parentSetSwimState now takes into account head height (diff)
downloadcuberite-49c443896dcac8c4eaf08c4024e8bd2366ad899a.tar
cuberite-49c443896dcac8c4eaf08c4024e8bd2366ad899a.tar.gz
cuberite-49c443896dcac8c4eaf08c4024e8bd2366ad899a.tar.bz2
cuberite-49c443896dcac8c4eaf08c4024e8bd2366ad899a.tar.lz
cuberite-49c443896dcac8c4eaf08c4024e8bd2366ad899a.tar.xz
cuberite-49c443896dcac8c4eaf08c4024e8bd2366ad899a.tar.zst
cuberite-49c443896dcac8c4eaf08c4024e8bd2366ad899a.zip
Diffstat (limited to 'src/Root.h')
-rw-r--r--src/Root.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/Root.h b/src/Root.h
index 09e2c7880..44567018d 100644
--- a/src/Root.h
+++ b/src/Root.h
@@ -1,11 +1,10 @@
-
+
#pragma once
#include "Protocol/Authenticator.h"
#include "Protocol/MojangAPI.h"
#include "HTTP/HTTPServer.h"
#include "Defines.h"
-#include <functional>
#include "RankManager.h"
@@ -28,8 +27,8 @@ class cSettingsRepositoryInterface;
class cDeadlockDetect;
class cUUID;
-using cPlayerListCallback = std::function<bool(cPlayer &)>;
-using cWorldListCallback = std::function<bool(cWorld &)>;
+typedef cItemCallback<cPlayer> cPlayerListCallback;
+typedef cItemCallback<cWorld> cWorldListCallback;
namespace Json
{
@@ -77,7 +76,7 @@ public:
// tolua_end
/** Calls the callback for each world; returns true if the callback didn't abort (return true) */
- bool ForEachWorld(const cWorldListCallback & a_Callback); // >> Exported in ManualBindings <<
+ bool ForEachWorld(cWorldListCallback & a_Callback); // >> Exported in ManualBindings <<
/** Writes chunkstats, for each world and totals, to the output callback */
void LogChunkStats(cCommandOutputCallback & a_Output);
@@ -137,16 +136,16 @@ public:
void SaveAllChunks(void); // tolua_export
/** Calls the callback for each player in all worlds */
- bool ForEachPlayer(const cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
+ bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
/** Finds a player from a partial or complete player name and calls the callback - case-insensitive */
- bool FindAndDoWithPlayer(const AString & a_PlayerName, const cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
+ bool FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
/** Finds the player over his uuid and calls the callback */
- bool DoWithPlayerByUUID(const cUUID & a_PlayerUUID, const cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
+ bool DoWithPlayerByUUID(const cUUID & a_PlayerUUID, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
/** Finds the player using it's complete username and calls the callback */
- bool DoWithPlayer(const AString & a_PlayerName, const cPlayerListCallback & a_Callback);
+ bool DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback);
/** Send playerlist of all worlds to player */
void SendPlayerLists(cPlayer * a_DestPlayer);