public override bool ParseArgs(IScenarioContent content, ref GotoArgs args, out string error) { // goto #flag; if (content.length != 2) { error = GetLengthErrorString(2); return(false); } args.flag = content[1]; error = null; return(true); }
private bool DoGoto(GotoArgs arguments, StringBuilder output) { if (arguments.Line < 1 || arguments.Line > this.lines.Count) { output.AppendLine("Line out of range"); return(false); } // Subtact 1 to adjust for 0-based indexing, and another 1 because the number will be incremented // immediately after processing this directive. this.currentLineNum = arguments.Line - 2; return(true); }
protected override ActionStatus Run(IGameAction gameAction, IScenarioContent content, GotoArgs args, out string error) { ScenarioAction action; if (!ParseAction <ScenarioAction>(gameAction, out action, out error)) { return(ActionStatus.Error); } return(action.GotoCommand(args.flag, out error)); }