diff options
author | peterbell10 <peterbell10@live.co.uk> | 2017-09-01 13:04:50 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-09-01 13:04:50 +0200 |
commit | 496c337cdfa593654018c171f6a74c28272265b5 (patch) | |
tree | fab48316d8fd6de97500ca1b8c8c5792eb578acc /src/Bindings/PluginManager.h | |
parent | Update Core plugin (diff) | |
download | cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.gz cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.bz2 cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.lz cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.xz cuberite-496c337cdfa593654018c171f6a74c28272265b5.tar.zst cuberite-496c337cdfa593654018c171f6a74c28272265b5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/PluginManager.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h index 66f7d290a..4de4bdeae 100644 --- a/src/Bindings/PluginManager.h +++ b/src/Bindings/PluginManager.h @@ -1,8 +1,9 @@ - + #pragma once #include "Defines.h" +#include <functional> @@ -194,7 +195,7 @@ public: /** The interface used for enumerating and extern-calling plugins */ - typedef cItemCallback<cPlugin> cPluginCallback; + using cPluginCallback = std::function<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, const 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(const 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; |