コード例 #1
0
ファイル: AsyncNativeProc.cs プロジェクト: wixoaGit/OpenDream
            public Task <DreamValue> Call(DreamProc proc, DreamObject src, DreamObject usr, DreamProcArguments arguments)
            {
                _callTcs        = new();
                _callProcNotify = proc.CreateState(Thread, src, usr, arguments);

                // The field may be mutated by SafeResume, so cache the task
                var callTcs = _callTcs;

                SafeResume();
                return(callTcs.Task);
            }
コード例 #2
0
        public bool TryGetValueAsProc(out DreamProc proc)
        {
            if (IsType(DreamValueType.DreamProc))
            {
                proc = (DreamProc)Value;

                return(true);
            }
            else
            {
                proc = null;

                return(false);
            }
        }
コード例 #3
0
 public DreamValue(DreamProc value)
 {
     Type  = DreamValueType.DreamProc;
     Value = value;
 }
コード例 #4
0
 public DreamProcIdentifierProc(DreamProc proc, DreamObject instance, string procName)
 {
     _proc    = new DreamValue(proc);
     Instance = instance;
     ProcName = procName;
 }
コード例 #5
0
 public DreamProcIdentifierSelfProc(DreamProc selfProc, DreamProcInterpreter interpreter)
 {
     SelfProc    = selfProc;
     Interpreter = interpreter;
 }
コード例 #6
0
 public NativeProc(string name, DreamProc superProc, List <String> argumentNames, List <DMValueType> argumentTypes, Dictionary <string, DreamValue> defaultArgumentValues, HandlerFn handler)
     : base(name, superProc, true, argumentNames, argumentTypes)
 {
     _defaultArgumentValues = defaultArgumentValues;
     Handler = handler;
 }
コード例 #7
0
ファイル: AsyncNativeProc.cs プロジェクト: wixoaGit/OpenDream
 public AsyncNativeProc(string name, DreamProc superProc, List <String> argumentNames, List <DMValueType> argumentTypes, Dictionary <string, DreamValue> defaultArgumentValues, Func <State, Task <DreamValue> > taskFunc, string?verbName, string?verbCategory, string?verbDesc, sbyte?invisibility)
     : base(name, superProc, ProcAttributes.None, argumentNames, argumentTypes, verbName, verbCategory, verbDesc, invisibility)
 {
     _defaultArgumentValues = defaultArgumentValues;
     _taskFunc = taskFunc;
 }
コード例 #8
0
 public NativeProc(DreamPath owningType, string name, DreamProc superProc, List <String> argumentNames, List <DMValueType> argumentTypes, Dictionary <string, DreamValue> defaultArgumentValues, HandlerFn handler, string?verbName, string?verbCategory, string?verbDesc, sbyte?invisibility)
     : base(owningType, name, superProc, ProcAttributes.None, argumentNames, argumentTypes, verbName, verbCategory, verbDesc, invisibility)
 {
     _defaultArgumentValues = defaultArgumentValues;
     Handler = handler;
 }
コード例 #9
0
 public DMProc(string name, DreamProc superProc, List <String> argumentNames, List <DMValueType> argumentTypes, byte[] bytecode, int maxStackSize, ProcAttributes attributes, string?verbName, string?verbCategory, string?verbDesc, sbyte?invisibility)
     : base(name, superProc, attributes, argumentNames, argumentTypes, verbName, verbCategory, verbDesc, invisibility)
 {
     Bytecode      = bytecode;
     _maxStackSize = maxStackSize;
 }
コード例 #10
0
ファイル: AsyncNativeProc.cs プロジェクト: ZeWaka/OpenDream
 public AsyncNativeProc(string name, DreamProc superProc, List <String> argumentNames, List <DMValueType> argumentTypes, Dictionary <string, DreamValue> defaultArgumentValues, Func <State, Task <DreamValue> > taskFunc)
     : base(name, superProc, true, argumentNames, argumentTypes)
 {
     _defaultArgumentValues = defaultArgumentValues;
     _taskFunc = taskFunc;
 }
コード例 #11
0
ファイル: DMProc.cs プロジェクト: redmoogle/OpenDream
        public void Call(DreamProc proc, DreamObject src, DreamProcArguments arguments)
        {
            var state = proc.CreateState(Thread, src, Usr, arguments);

            Thread.PushProcState(state);
        }
コード例 #12
0
ファイル: DMProc.cs プロジェクト: ZeWaka/OpenDream
 public DMProc(string name, DreamProc superProc, List <String> argumentNames, List <DMValueType> argumentTypes, byte[] bytecode, int maxStackSize, bool waitFor)
     : base(name, superProc, waitFor, argumentNames, argumentTypes)
 {
     Bytecode      = bytecode;
     _maxStackSize = maxStackSize;
 }