Beispiel #1
0
		static WrenForeignMethodFn BindForeignMethod(WrenVM VM, string Module, string ClassName, bool Static, string Sig) {
			if (ClassName == "DotNet" && Static) {
				if (Sig == "SomeFunction()")
					return SomeFunction;
			}
			return null;
		}
Beispiel #2
0
 public static extern void ReturnString(this WrenVM VM, string Txt = "", int Len = -1);
Beispiel #3
0
 public static extern void ReturnDouble(this WrenVM VM, double Val = 0.0);
Beispiel #4
0
 public static extern void ReturnBool(this WrenVM VM, bool Val = false);
Beispiel #5
0
 public static extern string GetArgumentString(this WrenVM VM, int Idx);
Beispiel #6
0
 public static extern double GetArgumentDouble(this WrenVM VM, int Idx);
Beispiel #7
0
 public static extern bool GetArgumentBool(this WrenVM VM, int Idx);
Beispiel #8
0
 public static extern void ReleaseMethod(this WrenVM VM, IntPtr Method);
Beispiel #9
0
 public static extern void Call(this WrenVM VM, IntPtr Method, string Types, __arglist);
Beispiel #10
0
 public static extern IntPtr GetMethod(this WrenVM VM, string Module, string Variable, string Signature);
Beispiel #11
0
 public static extern WrenInterpretResult Interpret(this WrenVM VM, string SrcPath, string Src);
Beispiel #12
0
 public static extern void FreeVM(this WrenVM VM);
Beispiel #13
0
		static string LoadModule(WrenVM VM, string Module) {
			if (File.Exists(Module))
				return File.ReadAllText(Module);
			return "";
		}
Beispiel #14
0
		static void SomeFunction(WrenVM VM) {
			VM.ReturnString("Hello Wren World #" + Rand.Next(1, 100) + "!");
		}