public override void Load(VMStackFrameMarshal input, VMContext context) { base.Load(input, context); var inR = (VMRoutingFrameMarshal)input; Rooms = new Stack<VMRoomPortal>(); for (int i=inR.Rooms.Length-1; i>=0; i--) Rooms.Push(inR.Rooms[i]); CurrentPortal = inR.CurrentPortal; ParentRoute = GetParentFrame(); //should be able to, since all arrays are generated left to right, including the stacks. WalkTo = (inR.WalkTo == null)?null:new LinkedList<Point>(inR.WalkTo); WalkDirection = inR.WalkDirection; TargetDirection = inR.TargetDirection; IgnoreRooms = inR.IgnoreRooms; State = inR.State; PortalTurns = inR.PortalTurns; WaitTime = inR.WaitTime; Timeout = inR.Timeout; Retries = inR.Retries; AttemptedChair = inR.AttemptedChair; TurnTweak = inR.TurnTweak; TurnFrames = inR.TurnFrames; MoveTotalFrames = inR.MoveTotalFrames; MoveFrames = inR.MoveFrames; Velocity = inR.Velocity; CallFailureTrees = inR.CallFailureTrees; IgnoredRooms = new HashSet<VMRoomPortal>(inR.IgnoredRooms); AvatarsToConsider = new HashSet<VMAvatar>(); foreach (var avatar in inR.AvatarsToConsider) AvatarsToConsider.Add((VMAvatar)context.VM.GetObjectById(avatar)); PreviousPosition = inR.PreviousPosition; CurrentWaypoint = inR.CurrentWaypoint; RoomRouteInvalid = inR.RoomRouteInvalid; Slot = inR.Slot; //NULLable Target = context.VM.GetObjectById(inR.Target); //object id if (inR.Choices != null) { Choices = new List<VMFindLocationResult>(); foreach (var c in inR.Choices) Choices.Add(new VMFindLocationResult(c, context)); } else Choices = null; CurRoute = (inR.CurRoute == null)?null:new VMFindLocationResult(inR.CurRoute, context); //NULLable }
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 VMRoutingFrame(VMStackFrameMarshal input, VMContext context, VMThread thread) { Thread = thread; Load(input, context); }