本文整理汇总了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.");
}
示例2: kOSException
public kOSException(String message, ExecutionContext context)
: this(message)
{
this.LineNumber = context.Line;
this.Context = context;
this.Program = context.FindClosestParentOfType<ContextRunProgram>();
}
示例3: ImmediateMode
public ImmediateMode(ExecutionContext parent)
: base(parent)
{
StdOut("kOS Operating System");
StdOut("KerboScript v" + Core.VersionInfo.ToString());
StdOut("");
StdOut("Proceed.");
}
示例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.");
}
示例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; });
}
示例6: InterpreterBootup
public InterpreterBootup(ExecutionContext parent)
: base(parent)
{
//ShowAnimationFrame(0);
PrintAt("BOOTING UP...", 22, 20);
State = ExecutionState.WAIT;
}
示例7: Expression
public Expression(String text, ExecutionContext context)
{
this.executionContext = context;
text = text.Trim();
Text = text;
UnwrapFullBrackets(ref text);
Process(text);
}
示例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;
}
示例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;
}
}
示例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);
}
示例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);
}
示例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); });
}
示例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.");
}
示例14: BodyTarget
public BodyTarget(CelestialBody target, ExecutionContext context)
{
this.context = context;
Target = target;
}
示例15: CommandDelete
public CommandDelete(Match regexMatch, ExecutionContext context)
: base(regexMatch, context)
{
}