Esempio n. 1
0
 /// <summary>Sets the print function of the virtual machine. This function is used by the built-in function '::print()' to output text.</summary>
 public void SetPrintFunc(PrintFunction print, PrintFunction error)
 {
     _printHook = (IntPtr v, string message) => print(this, message);
     _errorHook = (IntPtr v, string message) => error(this, message);
     Unmanaged.SetPrintFunc(Pointer, _printHook, _errorHook);
 }
Esempio n. 2
0
 /// <summary>Returns the current print function of the VM. (see <see cref="SetPrintFunc"/>)</summary>
 public PrintFunction GetPrintFunc()
 {
     Unmanaged.SqPrintFunction func = Unmanaged.GetPrintFunc(Pointer);
     return((Squirrel v, string message) => func(v.Pointer, message));
 }