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); }
public bool TryGetValueAsProc(out DreamProc proc) { if (IsType(DreamValueType.DreamProc)) { proc = (DreamProc)Value; return(true); } else { proc = null; return(false); } }
public DreamValue(DreamProc value) { Type = DreamValueType.DreamProc; Value = value; }
public DreamProcIdentifierProc(DreamProc proc, DreamObject instance, string procName) { _proc = new DreamValue(proc); Instance = instance; ProcName = procName; }
public DreamProcIdentifierSelfProc(DreamProc selfProc, DreamProcInterpreter interpreter) { SelfProc = selfProc; Interpreter = interpreter; }
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; }
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; }
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; }
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; }
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; }
public void Call(DreamProc proc, DreamObject src, DreamProcArguments arguments) { var state = proc.CreateState(Thread, src, Usr, arguments); Thread.PushProcState(state); }
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; }