From d3760311932c89af92808ee3079154bf215ad309 Mon Sep 17 00:00:00 2001 From: Simon Holmberg Date: Fri, 19 Oct 2012 03:01:26 +0200 Subject: [PATCH] Shorthands for exposing objects and functions to Lua. --- DepthsBelow/DepthsBelow/Lua.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/DepthsBelow/DepthsBelow/Lua.cs b/DepthsBelow/DepthsBelow/Lua.cs index d1ff5f0..618636f 100755 --- a/DepthsBelow/DepthsBelow/Lua.cs +++ b/DepthsBelow/DepthsBelow/Lua.cs @@ -105,6 +105,16 @@ namespace DepthsBelow "); } + public LuaInterface.LuaFunction Expose(string path, object target, System.Reflection.MethodBase function) + { + return lua.RegisterFunction(path, target, function); + } + + public void Expose(string path, object obj) + { + lua[path] = obj; + } + public void ResetContext() { if (lua != null)