當前位置: 首頁>>代碼示例>>C#>>正文


C# kOS.ExecutionContext類代碼示例

本文整理匯總了C#中kOS.ExecutionContext的典型用法代碼示例。如果您正苦於以下問題:C# ExecutionContext類的具體用法?C# ExecutionContext怎麽用?C# ExecutionContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExecutionContext類屬於kOS命名空間,在下文中一共展示了ExecutionContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ImmediateMode

        public ImmediateMode(ExecutionContext parent)
            : base(parent)
        {
            StdOut("kOS Operating System");
            StdOut("KerboScript v" + Core.VersionInfo.ToString());
            StdOut("");

            bool autoexecExists = false;
            if (SelectedVolume.GetByName("autoexec") != null) {
                autoexecExists = true;
            } else {
                Volume ArchiveVolume = GetVolume("Archive");

                if (ArchiveVolume.GetByName("autoexec") != null) {
                    Add("copy autoexec from archive.");
                    autoexecExists = true;
                }
            }

            if (autoexecExists) {
                StdOut("Executing autoexec...");
                Add("run autoexec.");
            } else {
                StdOut("Autoexec was not found.");
            }

            StdOut("Proceed.");
        }
開發者ID:JackDTaylor,項目名稱:KOS,代碼行數:28,代碼來源:InterpreterImmediate.cs

示例2: kOSException

 public kOSException(String message, ExecutionContext context)
     : this(message)
 {
     this.LineNumber = context.Line;
     this.Context = context;
     this.Program = context.FindClosestParentOfType<ContextRunProgram>();
 }
開發者ID:Nivekk,項目名稱:KOS,代碼行數:7,代碼來源:kOSException.cs

示例3: ImmediateMode

 public ImmediateMode(ExecutionContext parent)
     : base(parent)
 {
     StdOut("kOS Operating System");
     StdOut("KerboScript v" + Core.VersionInfo.ToString());
     StdOut("");
     StdOut("Proceed.");
 }
開發者ID:Jabe,項目名稱:KOS,代碼行數:8,代碼來源:InterpreterImmediate.cs

示例4: ImmediateMode

 public ImmediateMode(ExecutionContext parent)
     : base(parent)
 {
     StdOut("kOS Operating System Build " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision);
     StdOut("KerboScript v0.8");
     StdOut("");
     StdOut("Proceed.");
 }
開發者ID:raad287,項目名稱:KOS,代碼行數:8,代碼來源:InterpreterImmediate.cs

示例5: Atmosphere

        public Atmosphere(CelestialBody body, ExecutionContext context)
        {
            BodyRef = body;

            AddSuffix("HEIGHT", null, ()=>{ return BodyRef.atmosphereDepth; });
            AddSuffix("OXYGEN", null, () => { return BodyRef.atmosphere && BodyRef.atmosphereContainsOxygen; });
            AddSuffix("SEALEVELPRESSURE", null, () => { return BodyRef.atmospherePressureSeaLevel; });
        }
開發者ID:Nivekk,項目名稱:KOS,代碼行數:8,代碼來源:Atmosphere.cs

示例6: InterpreterBootup

        public InterpreterBootup(ExecutionContext parent)
            : base(parent)
        {
            //ShowAnimationFrame(0);
            PrintAt("BOOTING UP...", 22, 20);

            State = ExecutionState.WAIT;
        }
開發者ID:Nivekk,項目名稱:KOS,代碼行數:8,代碼來源:InterpreterBootup.cs

示例7: Expression

        public Expression(String text, ExecutionContext context)
        {
            this.executionContext = context;

            text = text.Trim();
            Text = text;

            UnwrapFullBrackets(ref text);

            Process(text);
        }
開發者ID:BGog,項目名稱:KOS,代碼行數:11,代碼來源:Expression.cs

示例8: InterpreterEdit

        public InterpreterEdit(String fileName, ExecutionContext parent)
            : base(parent)
        {
            File = SelectedVolume.GetByName(fileName);

            if (File == null)
            {
                File = new File(fileName);
                File.Add("");
            }

            CursorX = 0;
            CursorY = 2;
        }
開發者ID:BGog,項目名稱:KOS,代碼行數:14,代碼來源:InterpreterEdit.cs

示例9: Get

        public static Command Get(String input, ExecutionContext context, int line)
        {
            try
            {
                Command retCommand = Get(input, context);
                retCommand.Line = line;

                return retCommand;
            }
            catch (kOSException e)
            {
                e.LineNumber = line;
                throw e;
            }
        }
開發者ID:Nivekk,項目名稱:KOS,代碼行數:15,代碼來源:Command.cs

示例10: Expression

        public Expression(String text, ExecutionContext context)
        {
            this.executionContext = context;

            text = text.Trim();
            Text = text;

            if (!CheckForBrackets(text))
            {
                throw new kOSException("Bracket matching error.");
            }

            UnwrapFullBrackets(ref text);

            Process(text);
        }
開發者ID:kerbalspaceprogram-fr,項目名稱:KOS,代碼行數:16,代碼來源:Expression.cs

示例11: Expression

        public Expression(String text, ExecutionContext context)
        {
            this.executionContext = context;

            text = text.Trim();
            Text = text;

            if (!Utils.DelimterMatch (text))
            {
                throw new kOSException ("Error: mismatching delimiter.");
            }

            UnwrapFullBrackets(ref text);

            Process(text);
        }
開發者ID:raad287,項目名稱:KOS,代碼行數:16,代碼來源:Expression.cs

示例12: Body

        public Body(CelestialBody target, ExecutionContext context)
        {
            this.Context = context;
            this.BodyRef = target;

            AddSuffix("NAME", null, () => { return BodyRef.name; });
            AddSuffix("DESCRIPTION", null, () => { return BodyRef.bodyDescription; });
            AddSuffix("MASS", null, () => { return BodyRef.Mass; });
            AddSuffix("POSITION", null, () => { return new Vector(BodyRef.position); });
            AddSuffix("ALTITUDE", null, () => { return BodyRef.orbit.altitude; });
            AddSuffix("APOAPSIS", null, () => { return BodyRef.orbit.ApA; });
            AddSuffix("PERIAPSIS", null, () => { return BodyRef.orbit.PeA; });
            AddSuffix("VELOCITY", null, () => { return new Vector(BodyRef.orbit.GetVel()); });
            AddSuffix("DISTANCE", null, () => { return (float)GetDistance(); });
            AddSuffix("BODY", null, () => { return new Body(BodyRef.orbit.referenceBody, Context); });
            AddSuffix("MU", null, () => { return BodyRef.gravParameter; });
            AddSuffix("ROTATIONPERIOD", null, () => { return BodyRef.rotationPeriod; });
            AddSuffix("RADIUS", null, () => { return BodyRef.Radius; });
            AddSuffix("GRAVITY", null, () => { return BodyRef.gravParameter; });
            AddSuffix("OCEANIC", null, () => { return BodyRef.ocean; });
            AddSuffix("ATMOSPHERE", null, () => { return new Atmosphere(BodyRef, Context); });
            AddSuffix("ATM", null, () => { return new Atmosphere(BodyRef, Context); });
        }
開發者ID:Nivekk,項目名稱:KOS,代碼行數:23,代碼來源:BodyTarget.cs

示例13: ImmediateMode

        public ImmediateMode(ExecutionContext parent)
            : base(parent)
        {
            //StdOut("kOS Operating System");
            //StdOut("KerboScript v" + Core.VersionInfo.ToString());

            for (var y = 13; y < 16; y++)
            {
                string output = "";
                for (var x = 11; x < 16; x++)
                {
                    output += ((char)((y*16) + x)).ToString();
                }

                if (y == 15) output += " v" + Core.VersionInfo.ToString();

                StdOut(output);
            }

            StdOut("");
            StdOut("");
            StdOut("Proceed.");
        }
開發者ID:Nivekk,項目名稱:KOS,代碼行數:23,代碼來源:InterpreterImmediate.cs

示例14: BodyTarget

 public BodyTarget(CelestialBody target, ExecutionContext context)
 {
     this.context = context;
     Target = target;
 }
開發者ID:niomaster,項目名稱:KOS,代碼行數:5,代碼來源:BodyTarget.cs

示例15: CommandDelete

 public CommandDelete(Match regexMatch, ExecutionContext context)
     : base(regexMatch, context)
 {
 }
開發者ID:BGog,項目名稱:KOS,代碼行數:4,代碼來源:CommandFileIO.cs


注:本文中的kOS.ExecutionContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。