summaryrefslogtreecommitdiffstats
path: root/src/Root.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-09-11 23:20:49 +0200
committerMattes D <github@xoft.cz>2017-09-11 23:20:49 +0200
commite225b7f8262df48ad4d7094bc295add3007b0649 (patch)
treea42e9afcc88cfe6e9d1258458e3ad42764083d0e /src/Root.h
parentcBlockArea: change MakeIndex to return size_t (diff)
downloadcuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar
cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.gz
cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.bz2
cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.lz
cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.xz
cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.zst
cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.zip
Diffstat (limited to 'src/Root.h')
-rw-r--r--src/Root.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Root.h b/src/Root.h
index 46b202c88..4f191cf35 100644
--- a/src/Root.h
+++ b/src/Root.h
@@ -5,6 +5,7 @@
#include "Protocol/MojangAPI.h"
#include "HTTP/HTTPServer.h"
#include "Defines.h"
+#include "FunctionRef.h"
#include "RankManager.h"
@@ -27,8 +28,8 @@ class cSettingsRepositoryInterface;
class cDeadlockDetect;
class cUUID;
-typedef cItemCallback<cPlayer> cPlayerListCallback;
-typedef cItemCallback<cWorld> cWorldListCallback;
+using cPlayerListCallback = cFunctionRef<bool(cPlayer &)>;
+using cWorldListCallback = cFunctionRef<bool(cWorld &)>;
namespace Json
{
@@ -76,7 +77,7 @@ public:
// tolua_end
/** Calls the callback for each world; returns true if the callback didn't abort (return true) */
- bool ForEachWorld(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);
@@ -139,16 +140,16 @@ public:
void SetSavingEnabled(bool a_SavingEnabled); // tolua_export
/** Calls the callback for each player in all worlds */
- bool ForEachPlayer(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, 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, 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, cPlayerListCallback & a_Callback);
+ bool DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback a_Callback);
/** Send playerlist of all worlds to player */
void SendPlayerLists(cPlayer * a_DestPlayer);