summaryrefslogtreecommitdiffstats
path: root/source/squirrelbindings/cSquirrelBaseClass.h
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-09 17:53:17 +0200
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-09 17:53:17 +0200
commitd82e2449a0282232c6e6acd1a84514ee5332f4db (patch)
tree6935f3cd4a9d3050b1aed8b1b0f9514f5fcff17f /source/squirrelbindings/cSquirrelBaseClass.h
parentSorry... (diff)
downloadcuberite-d82e2449a0282232c6e6acd1a84514ee5332f4db.tar
cuberite-d82e2449a0282232c6e6acd1a84514ee5332f4db.tar.gz
cuberite-d82e2449a0282232c6e6acd1a84514ee5332f4db.tar.bz2
cuberite-d82e2449a0282232c6e6acd1a84514ee5332f4db.tar.lz
cuberite-d82e2449a0282232c6e6acd1a84514ee5332f4db.tar.xz
cuberite-d82e2449a0282232c6e6acd1a84514ee5332f4db.tar.zst
cuberite-d82e2449a0282232c6e6acd1a84514ee5332f4db.zip
Diffstat (limited to '')
-rw-r--r--source/squirrelbindings/cSquirrelBaseClass.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/squirrelbindings/cSquirrelBaseClass.h b/source/squirrelbindings/cSquirrelBaseClass.h
index a66ca7ddd..279c47027 100644
--- a/source/squirrelbindings/cSquirrelBaseClass.h
+++ b/source/squirrelbindings/cSquirrelBaseClass.h
@@ -3,6 +3,7 @@
#include "../cPlugin_Squirrel.h"
#include "../cPluginManager.h"
#include "../cRoot.h"
+#include "../cSquirrelCommandBinder.h"
//The baseclass for squirrel plugins
class cSquirrelBaseClass
@@ -24,6 +25,17 @@ public:
cRoot::Get()->GetPluginManager()->AddHook(m_Instance, (cPluginManager::PluginHook) a_Hook);
}
+ void AddCommand( std::string a_Command, std::string a_Description, std::string a_Permission )
+ {
+ if(m_Instance) m_Instance->AddCommand(a_Command, a_Description, a_Permission);
+ }
+
+ bool BindCommand( const std::string a_Command, const std::string a_Permission, Sqrat::Function a_Callback)
+ {
+ if(!m_Instance) return false;
+ return cRoot::Get()->GetPluginManager()->GetSquirrelCommandBinder()->BindCommand(a_Command, a_Permission, m_Instance, a_Callback);
+ }
+
protected:
cPlugin_Squirrel *m_Instance;
}; \ No newline at end of file