diff options
author | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-09 17:53:17 +0200 |
---|---|---|
committer | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-09 17:53:17 +0200 |
commit | d82e2449a0282232c6e6acd1a84514ee5332f4db (patch) | |
tree | 6935f3cd4a9d3050b1aed8b1b0f9514f5fcff17f /source/cSquirrelCommandBinder.h | |
parent | Sorry... (diff) | |
download | cuberite-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/cSquirrelCommandBinder.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source/cSquirrelCommandBinder.h b/source/cSquirrelCommandBinder.h new file mode 100644 index 000000000..50e026d06 --- /dev/null +++ b/source/cSquirrelCommandBinder.h @@ -0,0 +1,35 @@ +#pragma once
+#include <string>
+#include <sqrat.h>
+
+class cPlugin;
+class cPlayer;
+
+class cSquirrelCommandBinder
+{
+public:
+ cSquirrelCommandBinder();
+ ~cSquirrelCommandBinder();
+
+ bool HandleCommand( const std::string & a_Command, cPlayer* a_Player );
+
+ bool BindCommand( const std::string & a_Command, const std::string & a_Permission, cPlugin* a_Plugin, Sqrat::Function a_Callback);
+
+ void ClearBindings();
+ void RemoveBindingsForPlugin( cPlugin* a_Plugin );
+private:
+ struct BoundFunction
+ {
+ Sqrat::Function Callback;
+ cPlugin *Plugin;
+ std::string Permission;
+ };
+
+ typedef std::map< std::string, BoundFunction > CommandMap;
+ CommandMap m_BoundCommands;
+};
+
+
+
+
+
|