예제 #1
0
        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;
        }
예제 #2
0
파일: Data.cs 프로젝트: Cidolfas/Aster
 public static void LoadStoryletFile(string path)
 {
     var loader = new StoryletLoader();
     loader.LoadTextFile(path, Storylets);
 }