public static bool AddLine(string line) { if (line == null) return false; if (line.StartsWith("#")) { return true; } else if (line == "Storylets") { LoadingStorylets = true; } else if (line == "Qualities") { LoadingStorylets = false; } else if (line.StartsWith("gdoc: ")) { string url = GetPath(line); if (url != null) { if (LoadingStorylets) { var loader = new StoryletLoader(); loader.LoadGDoc(url, Data.Storylets); } else { var loader = new QualityLoader(); loader.LoadGDoc(url, Data.Qualities); } } } else if (line.StartsWith("file: ")) { string path = GetPath(line); if (path != null) { if (LoadingStorylets) { var loader = new StoryletLoader(); loader.LoadTextFile(path, Data.Storylets); } else { var loader = new QualityLoader(); loader.LoadTextFile(path, Data.Qualities); } } } // else if (line.StartsWith("dir: ")) // { // } return true; }
public static void LoadQualitiesFile(string path) { var loader = new QualityLoader(); loader.LoadTextFile(path, Qualities); }