public static AtStatement GetStatement(string name, DialogueLine param) { if (statements.ContainsKey(name)) { return statements[name](param); } if (name[0] == '@') { return new NoSuchStatement(param); } return new NoopStatement(); }
public NoSuchStatement(DialogueLine line) { statement = line; }
public AtInclude(DialogueLine param) { File = DialogueFile.Open(param.Content); }
public void PrintWarning(DialogueLine source, string message, params string[] extras) { message = String.Format(message, extras); Console.Error.WriteLine("WARNING: {0} (at location {1}:{2})", message, source.File.FileNameWithExt, source.LineNumber); }
public void Error(DialogueLine source, string message, params string[] extras) { message = String.Format(message, extras); Console.Error.WriteLine("ERROR: {0} (at location {1}:{2})", message, source.File.FileNameWithExt, source.LineNumber); hadError = true; }
public void Parse() { if (contents != null) { return; } contents = new List<DialogueLine>(); var line = file.ReadLine(); while (line != null) { lineNumber += 1; line = line.Trim(); if (line.Length > 0) { var dlgLine = new DialogueLine(line, this, lineNumber); if (dlgLine.InterpretAtSigns()) { contents.Add(dlgLine); } } line = file.ReadLine(); } if (ChapterName != null) { foreach (var l in Lines) { l.Options.SetCheck(DialogueCompiler.ChapterVariable, ChapterName); } } }