コード例 #1
0
        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);
        }
コード例 #2
0
        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
            });
        }
コード例 #3
0
ファイル: VMQueuedAction.cs プロジェクト: jwofles/ForkSO
        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;
        }
コード例 #4
0
ファイル: VMThread.cs プロジェクト: jwofles/ForkSO
        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
            });
        }
コード例 #5
0
ファイル: VMQueuedAction.cs プロジェクト: jwofles/ForkSO
 public VMQueuedAction(VMQueuedActionMarshal input, VMContext context)
 {
     Load(input, context);
 }