Primitive() публичный Метод

public Primitive ( ObjClass objClass, string s, Primitive func ) : void
objClass Wren.Core.Objects.ObjClass
s string
func Primitive
Результат void
Пример #1
0
        public static void LoadLibrary(WrenVM vm)
        {
            vm.Interpret("io", "io", IoSource);
            ObjClass file = (ObjClass)vm.FindVariable("io", "File");
            vm.Primitive(file.ClassObj, "open_(_,_)", Open);
            vm.Primitive(file.ClassObj, "sizePath_(_,_)", SizePath);

            vm.Primitive(file, "close_(_)", Close);
            vm.Primitive(file, "descriptor", Descriptor);
            vm.Primitive(file, "readBytes_(_,_)", ReadBytes);
            vm.Primitive(file, "size_(_)", Size);
        }
Пример #2
0
        public static void LoadLibrary(WrenVM vm)
        {
            vm.Interpret("", "", MetaLibSource);

            ObjClass meta = (ObjClass)vm.FindVariable("Meta");
            vm.Primitive(meta.ClassObj, "eval(_)", Eval);
        }
Пример #3
0
 public static void LoadLibrary(WrenVM vm)
 {
     vm.Interpret("scheduler", "scheduler", _schedulerSource);
     ObjClass scheduler = (ObjClass)vm.FindVariable("scheduler", "Scheduler");
     vm.Primitive(scheduler.ClassObj, "captureMethods_()", CaptureMethods);
     vm.Interpret("scheduler", "scheduler", "Scheduler.captureMethods_()");
 }
Пример #4
0
 public static void LoadIOLibrary(WrenVM vm)
 {
     vm.Interpret("", IOLibSource);
     ObjClass IO = (ObjClass)vm.FindVariable("IO").Obj;
     vm.Primitive(IO.ClassObj, "writeString_(_)", WriteString);
     vm.Primitive(IO.ClassObj, "read", Read);
     vm.Primitive(IO.ClassObj, "clock", Clock);
     vm.Primitive(IO.ClassObj, "time", Time);
 }
Пример #5
0
 public static void LoadLibrary(WrenVM vm)
 {
     vm.Interpret("timer", "timer", _timerSource);
     ObjClass timer = (ObjClass)vm.FindVariable("timer", "Timer");
     vm.Primitive(timer.ClassObj, "startTimer_(_,_)", StartTimer);
 }