Esempio n. 1
0
        public TemplateDatabase()
        {
            cfg    = JECSUConfig.current;
            parser = new TemplateDatabaseParser();
            parser.Initialize(cfg);


            fillDatabase(parser);


            contructor = new EntityConstructor();
            contructor.Initialize();
            fillEntitiesDictionary();
        }
Esempio n. 2
0
        void fillDatabase(TemplateDatabaseParser parser)
        {
            //Get list of all templates from directory in config
            var templatesFromParser = parser.FullReadDatabase();
            //add them to database while checking for duplicates
            int count = templatesFromParser.Count;

            for (int i = 0; i < count; i++)
            {
                if (alltemplates.ContainsKey(templatesFromParser[i].databaseID))
                {
                    Debug.LogError("Database already contains " + templatesFromParser[i].ToString());
                    return;
                }
                else
                {
                    alltemplates.Add(templatesFromParser[i].databaseID, templatesFromParser[i]);
                }
            }
        }