summaryrefslogtreecommitdiffstats
path: root/source/squirrelbindings/SquirrelBindings.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-08 23:01:08 +0200
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-08 23:01:08 +0200
commit083228a10dffcaa77b1d0035c29013c6802befd4 (patch)
tree4d8ba1ce8501f044d10135e836e6f956f1b99fa4 /source/squirrelbindings/SquirrelBindings.cpp
parentAdded a lilypad finisher (diff)
downloadcuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.gz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.bz2
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.lz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.xz
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.tar.zst
cuberite-083228a10dffcaa77b1d0035c29013c6802befd4.zip
Diffstat (limited to '')
-rw-r--r--source/squirrelbindings/SquirrelBindings.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/source/squirrelbindings/SquirrelBindings.cpp b/source/squirrelbindings/SquirrelBindings.cpp
new file mode 100644
index 000000000..27a82c306
--- /dev/null
+++ b/source/squirrelbindings/SquirrelBindings.cpp
@@ -0,0 +1,52 @@
+#include "Globals.h"
+#include "SquirrelBindings.h"
+#include "SquirrelFunctions.h"
+
+#include "cSquirrelBaseClass.h"
+
+#include "../cPlayer.h"
+
+using namespace Sqrat;
+
+
+
+void BindSquirrel(HSQUIRRELVM vm)
+{
+ RootTable()
+ .Bind("Plugin", Class<cSquirrelBaseClass>()
+ .Func("AddHook", &cSquirrelBaseClass::AddHook)
+ );
+ RootTable().Bind("cPlayer", Class<cPlayer, NoConstructor>()
+ .Func("GetName", &cPlayer::GetName)
+ );
+
+
+ RootTable().Func("print", &sqPrint);
+
+
+ ConstTable().Enum("Hook", Enumeration()
+ .Const("Tick", cPluginManager::HOOK_TICK)
+ .Const("Chat", cPluginManager::HOOK_CHAT)
+ .Const("CollectItem", cPluginManager::HOOK_COLLECT_ITEM)
+ .Const("BlockDig", cPluginManager::HOOK_BLOCK_DIG)
+ .Const("BlockPlace", cPluginManager::HOOK_BLOCK_PLACE)
+ .Const("Disconnect", cPluginManager::HOOK_DISCONNECT)
+ .Const("Handshake", cPluginManager::HOOK_HANDSHAKE)
+ .Const("Login", cPluginManager::HOOK_LOGIN)
+ .Const("PlayerSpawn", cPluginManager::HOOK_PLAYER_SPAWN)
+ .Const("PlayerJoin", cPluginManager::HOOK_PLAYER_JOIN)
+ .Const("PlayerMove", cPluginManager::HOOK_PLAYER_MOVE)
+ .Const("TakeDamage", cPluginManager::HOOK_TAKE_DAMAGE)
+ .Const("Killed", cPluginManager::HOOK_KILLED)
+ .Const("ChunkGenerated", cPluginManager::HOOK_CHUNK_GENERATED)
+ .Const("ChunkGenerating", cPluginManager::HOOK_CHUNK_GENERATING)
+ .Const("BlockToDrops", cPluginManager::HOOK_BLOCK_TO_DROPS)
+ .Const("PreCrafting", cPluginManager::HOOK_PRE_CRAFTING)
+ .Const("CraftingNoRecipe", cPluginManager::HOOK_CRAFTING_NO_RECIPE)
+ .Const("PostCrafting", cPluginManager::HOOK_POST_CRAFTING)
+ .Const("BlockToPickup", cPluginManager::HOOK_BLOCK_TO_PICKUP)
+ .Const("WeatherChanged", cPluginManager::HOOK_WEATHER_CHANGED)
+ .Const("UpdatingSign", cPluginManager::HOOK_UPDATING_SIGN)
+ .Const("UpdatedSign", cPluginManager::HOOK_UPDATED_SIGN));
+
+} \ No newline at end of file