public void Load(VMQueuedActionMarshal input, VMContext context) { CodeOwner = FSO.Content.Content.Get().WorldObjects.Get(input.CodeOwnerGUID); BHAV bhav = null; if (input.RoutineID >= 8192) { bhav = CodeOwner.Resource.SemiGlobal.Get <BHAV>(input.RoutineID); } else if (input.RoutineID >= 4096) { bhav = CodeOwner.Resource.Get <BHAV>(input.RoutineID); } else { bhav = context.Globals.Resource.Get <BHAV>(input.RoutineID); } Routine = context.VM.Assemble(bhav); Callee = context.VM.GetObjectById(input.Callee); StackObject = context.VM.GetObjectById(input.StackObject); IconOwner = context.VM.GetObjectById(input.IconOwner); Name = input.Name; Args = input.Args; InteractionNumber = input.InteractionNumber; Cancelled = input.Cancelled; Priority = input.Priority; Mode = input.Mode; Flags = input.Flags; UID = input.UID; Callback = (input.Callback == null)?null:new VMActionCallback(input.Callback, context); }
public virtual VMThreadMarshal Save() { var stack = new VMStackFrameMarshal[Stack.Count]; int i = 0; foreach (var item in Stack) { stack[i++] = item.Save(); } var queue = new VMQueuedActionMarshal[Queue.Count]; i = 0; foreach (var item in Queue) { queue[i++] = item.Save(); } return(new VMThreadMarshal { Stack = stack, Queue = queue, TempRegisters = TempRegisters, TempXL = TempXL, LastStackExitCode = LastStackExitCode, BlockingDialog = BlockingDialog, Interrupt = Interrupt, ActionUID = ActionUID, DialogCooldown = DialogCooldown }); }
public void Load(VMQueuedActionMarshal input, VMContext context) { CodeOwner = FSO.Content.Content.Get().WorldObjects.Get(input.CodeOwnerGUID); if (input.RoutineID >= 8192) { ActionRoutine = (VMRoutine)CodeOwner.Resource.SemiGlobal.GetRoutine(input.RoutineID); } else if (input.RoutineID >= 4096) { ActionRoutine = (VMRoutine)CodeOwner.Resource.GetRoutine(input.RoutineID); } else { ActionRoutine = (VMRoutine)context.Globals.Resource.GetRoutine(input.RoutineID); } if (input.CheckRoutineID != 0) { if (input.CheckRoutineID >= 8192) { CheckRoutine = (VMRoutine)CodeOwner.Resource.SemiGlobal.GetRoutine(input.CheckRoutineID); } else if (input.CheckRoutineID >= 4096) { CheckRoutine = (VMRoutine)CodeOwner.Resource.GetRoutine(input.CheckRoutineID); } else { CheckRoutine = (VMRoutine)context.Globals.Resource.GetRoutine(input.CheckRoutineID); } } Callee = context.VM.GetObjectById(input.Callee); StackObject = context.VM.GetObjectById(input.StackObject); IconOwner = context.VM.GetObjectById(input.IconOwner); Name = input.Name; Args = input.Args; InteractionNumber = input.InteractionNumber; Cancelled = input.Cancelled; Priority = input.Priority; Mode = input.Mode; Flags = input.Flags; Flags2 = input.Flags2; UID = input.UID; Callback = (input.Callback == null)?null:new VMActionCallback(input.Callback, context); InteractionResult = input.InteractionResult; ResultCheckCounter = input.ResultCheckCounter; }
public virtual VMThreadMarshal Save() { var stack = new VMStackFrameMarshal[Stack.Count]; int i = 0; foreach (var item in Stack) { stack[i++] = item.Save(); } var queue = new VMQueuedActionMarshal[Queue.Count]; i = 0; foreach (var item in Queue) { queue[i++] = item.Save(); } return(new VMThreadMarshal { Stack = stack, Queue = queue, ActiveQueueBlock = ActiveQueueBlock, TempRegisters = (short[])TempRegisters.Clone(), TempXL = (int[])TempXL.Clone(), LastStackExitCode = LastStackExitCode, BlockingState = BlockingState, EODConnection = EODConnection, Interrupt = Interrupt, ActionUID = ActionUID, DialogCooldown = DialogCooldown, ScheduleIdleStart = ScheduleIdleStart }); }
public VMQueuedAction(VMQueuedActionMarshal input, VMContext context) { Load(input, context); }