summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginManager.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/Bindings/PluginManager.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 '')
-rw-r--r--src/Bindings/PluginManager.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h
index 66f7d290a..fdc1d1e7a 100644
--- a/src/Bindings/PluginManager.h
+++ b/src/Bindings/PluginManager.h
@@ -3,6 +3,7 @@
#include "Defines.h"
+#include "FunctionRef.h"
@@ -194,7 +195,7 @@ public:
/** The interface used for enumerating and extern-calling plugins */
- typedef cItemCallback<cPlugin> cPluginCallback;
+ using cPluginCallback = cFunctionRef<bool(cPlugin &)>;
typedef std::list<cPlugin *> PluginList;
@@ -372,18 +373,18 @@ public:
/** Calls the specified callback with the plugin object of the specified plugin.
Returns false if plugin not found, otherwise returns the value that the callback has returned. */
- bool DoWithPlugin(const AString & a_PluginName, cPluginCallback & a_Callback);
+ bool DoWithPlugin(const AString & a_PluginName, cPluginCallback a_Callback);
/** Calls the specified callback for each plugin in m_Plugins.
Returns true if all plugins have been reported, false if the callback has aborted the enumeration by returning true. */
- bool ForEachPlugin(cPluginCallback & a_Callback);
+ bool ForEachPlugin(cPluginCallback a_Callback);
/** Returns the name of the folder (cPlugin::GetFolderName()) from which the specified plugin was loaded. */
AString GetPluginFolderName(const AString & a_PluginName); // tolua_export
/** Returns the path where individual plugins' folders are expected.
The path doesn't end in a slash. */
- static AString GetPluginsPath(void) { return FILE_IO_PREFIX + AString("Plugins"); } // tolua_export
+ static AString GetPluginsPath(void) { return FILE_IO_PREFIX "Plugins"; } // tolua_export
private:
friend class cRoot;