コード例 #1
0
ファイル: FileDatabase.cs プロジェクト: DHunte/chocolate-box
        protected override BINFile LoadScripts()
        {
            BINFileController c = (BINFileController)
                                  AutoLoad(Settings.GetString("Files", "Scripts"));

            if (c == null)
            {
                return(null);
            }

            return(c.BIN);
        }
コード例 #2
0
ファイル: FileDatabase.cs プロジェクト: DHunte/chocolate-box
        public FileController Get(string fileName)
        {
            fileName = GetAbsoluteFileName(fileName);

            FileController c = Find(fileName);

            if (c != null)
            {
                // Already in the system.
                return(c);
            }

            FileInfo info = new FileInfo(fileName);

            string ext = info.Extension.ToUpper();

            if (ext == ".BIG")
            {
                c = new BIGFileController(this, fileName);
            }
            else if (ext == ".BIN")
            {
                if (info.Name.ToUpper() == "NAMES.BIN")
                {
                    c = new NamesBINController(this, fileName);
                }
                else
                {
                    c = new BINFileController(this, fileName);
                }
            }
            else if (ext == ".STB")
            {
                c = new BBBFileController(
                    this, new FableMod.STB.STBFile(), fileName);
            }
            else if (ext == ".WAD")
            {
                c = new BBBFileController(
                    this, new FableMod.BBB.BBBFile(), fileName);
            }
            else if (ext == ".WLD")
            {
                c = new WLDFileController(this, fileName);
            }

            if (c != null)
            {
                myFiles.Add(c);
            }

            return(c);
        }