Esempio n. 1
0
        /// <summary>
        ///		box.def ファイルからBOXノードを生成する。
        /// </summary>
        public BoxNode(VariablePath BOX定義ファイルパス, Node 親ノード)
            : this()
        {
            var box = BoxDef.復元する(BOX定義ファイルパス);

            this.タイトル = box.TITLE;
            this.親ノード = 親ノード;
        }
Esempio n. 2
0
        public static BoxDef 復元する(VariablePath Box定義ファイルパス)
        {
            var boxDef = new BoxDef();

            using (var sr = new StreamReader(Box定義ファイルパス.数なしパス, Encoding.GetEncoding(932 /*Shift-JIS*/)))
            {
                string 行;

                while ((行 = sr.ReadLine()) != null)
                {
                    try
                    {
                        string パラメータ = "";

                        #region " TITLE コマンド "
                        //---------------------
                        if (スコア.コマンドのパラメータ文字列部分を返す(行, @"TITLE", out パラメータ))
                        {
                            boxDef.TITLE = パラメータ;
                            continue;
                        }
                        //---------------------
                        #endregion
                        #region " ARTIST コマンド "
                        //---------------------
                        if (スコア.コマンドのパラメータ文字列部分を返す(行, @"ARTIST", out パラメータ))
                        {
                            boxDef.ARTIST = パラメータ;
                            continue;
                        }
                        //---------------------
                        #endregion
                    }
                    catch
                    {
                        // 例外は無視。
                    }
                }
            }

            return(boxDef);
        }