コード例 #1
0
ファイル: LevelScripts.cs プロジェクト: bblpny/Quad64
 protected sealed override byte EvaluateRuntime(Script.Runtime Source)
 {
     return(Runtime.Evaluate((Runtime)Source));
 }
コード例 #2
0
ファイル: LevelScripts.cs プロジェクト: bblpny/Quad64
 protected sealed override Script.Runtime CloneRuntime(Script.Runtime Source)
 {
     return(new Runtime((Runtime)Source));
 }
コード例 #3
0
ファイル: GeoScripts.cs プロジェクト: bblpny/Quad64
        // always takes over.
        protected sealed override bool RunCommand(Script.Runtime _rt, CommandInfo info, ref ByteSegment cmd)
        {
            Runtime   rt = (Runtime)_rt;
            GeoParent switcher;

#if DEBUG
            rt.counter[cmd[0]]++;
            int put_pos = 1;
            if (rt.rootNode.JumpCall == 0)
            {
                rt.log.Append(" >");
            }
            else
            {
                rt.log.Append(">>");
            }
            if (null != (object)rt.nodeCurrent)
            {
                for (uint depth = rt.nodeCurrent.Depth; depth != 0; --depth)
                {
                    switcher = rt.nodeCurrent;
                    for (uint back = depth; back != 0; --back)
                    {
                        switcher = ((GeoNode)switcher).Outer;
                    }
                    rt.log.Append(0 == switcher.JumpCall ? "| ":"|>");
                }

                rt.log.Append(0 == rt.nodeCurrent.JumpCall ? "| " : "|:");

                put_pos += 1 + (int)rt.nodeCurrent.Depth;
            }
            if (cmd[0] == 0x05)
            {
                rt.log.Append('\'');
            }
            else if (cmd[0] == 0x04)
            {
                rt.log.Append('+');
            }
            else
            {
                rt.log.Append('|');
            }
            if (rt.currentParent.JumpCall == 0)
            {
                rt.log.Append('-');
            }
            else
            {
                rt.log.Append('~');
            }
            put_pos++;
            put_pos <<= 1;

            rt.log.Append(bytesToUInt16(cmd).ToString("X4"));
            //System.Console.Write('+');
            //System.Console.Write(cmd.Length.ToString("00"));
            put_pos += 4;
            while (put_pos++ < 40)
            {
                rt.log.Append(' ');
            }

            for (int b = 2; b < cmd.Length; b++)
            {
                if (b != 2)
                {
                    rt.log.Append(' ');
                }
                rt.log.Append(cmd[b].ToString("X2"));
            }
            rt.log.AppendLine();
#endif
            if (cmd[0] != 0x05 &&
                (switcher = rt.currentParent).isSwitch &&
                switcher.switchPos != 1)
            {
                if (switcher.switchFunc == 0x8029DB48)
                {
                    //rom.printArray(cmd, cmdLen);
                    //Console.WriteLine(nodeCurrent.switchPos);

                    cmd = default(ByteSegment);
                }
            }
            else if (0 != (info.Traits & CommandInfoTraits.HasDelegate))
            {
                ((Runtime.Command)info.Delegate)(rt, ref cmd);
            }

            if ((switcher = rt.currentParent).isSwitch)
            {
                switcher.switchPos++;
            }

            // we did (or decided not to do) the command so don't have the base do it.
            return(false);
        }