public static ScreenThing Parse(IMyGridTerminalSystem gts, String input) { ScreenThing res = new ScreenThing(gts); try { int last = 0; bool b = false; int i = 0; while (i < input.Length) { char ch = input[i]; if (!b) { if (ch == '<') { b = true; if (i > 0) { res.Add(input.Substring(last, i - last), true); } last = i + 1; } } else { if (ch == '>') { res.Add(input.Substring(last, i - last), false); last = i + 1; b = false; } } ++i; } if (b) { throw new InvalidOperationException("Unterminated instruction"); } if (last != input.Length) { res.Add(input.Substring(last), true); } } catch (Exception ex) { res.error = ex.ToString(); } return(res); }
public ScreenElementGas(ScreenThing owner) : base(owner) { }
public ScreenElementItemCount(ScreenThing owner) : base(owner) { }
public ScreenElementLiteral(ScreenThing owner, string val) : base(owner) { this.val = val; }
public ScreenElement(ScreenThing owner) { this.owner = owner; }