Esempio n. 1
0
            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);
            }
Esempio n. 2
0
        public bool TryGetValueAsProc(out DreamProc proc)
        {
            if (IsType(DreamValueType.DreamProc))
            {
                proc = (DreamProc)Value;

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

                return(false);
            }
        }
Esempio n. 3
0
 public DreamValue(DreamProc value)
 {
     Type  = DreamValueType.DreamProc;
     Value = value;
 }
Esempio n. 4
0
 public DreamProcIdentifierProc(DreamProc proc, DreamObject instance, string procName)
 {
     _proc    = new DreamValue(proc);
     Instance = instance;
     ProcName = procName;
 }
Esempio n. 5
0
 public DreamProcIdentifierSelfProc(DreamProc selfProc, DreamProcInterpreter interpreter)
 {
     SelfProc    = selfProc;
     Interpreter = interpreter;
 }
Esempio n. 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;
 }
Esempio n. 7
0
 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 10
0
 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;
 }
Esempio n. 11
0
        public void Call(DreamProc proc, DreamObject src, DreamProcArguments arguments)
        {
            var state = proc.CreateState(Thread, src, Usr, arguments);

            Thread.PushProcState(state);
        }
Esempio n. 12
0
 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;
 }