public TemplateDatabase() { cfg = JECSUConfig.current; parser = new TemplateDatabaseParser(); parser.Initialize(cfg); fillDatabase(parser); contructor = new EntityConstructor(); contructor.Initialize(); fillEntitiesDictionary(); }
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]); } } }