Esempio n. 1
0
        /* Code: ID of the column.
         * Label: name of the row i.e: _117_coupe_68.
         */


        public SpecDB(string folderName, SpecDBFolder type, bool loadAsOriginalImplementation)
        {
            FolderName = folderName;

            if (folderName.Length > 4 && int.TryParse(folderName.Substring(folderName.Length - 4, 4), out int vers))
            {
                Version = vers;
            }
            else
            {
                string typeName = type.ToString();
                Version = int.Parse(typeName.Substring(typeName.Length - 4, 4));
            }


            SpecDBFolderType = type;

            SpecDBName = Path.GetFileNameWithoutExtension(folderName);
            LoadingAsOriginalImplementation = loadAsOriginalImplementation;

            if (LoadingAsOriginalImplementation)
            {
                Fixed_Tables = new SpecDBTable[SPEC_DB_TABLE_COUNT];
                for (int i = 0; i < Fixed_Tables.Length; i++)
                {
                    Fixed_Tables[i] = new SpecDBTable(TABLE_NAMES[i]);
                }
            }
            else
            {
                Tables = new Dictionary <string, SpecDBTable>();
            }
        }