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


            fillDatabase(parser);


            contructor = new EntityConstructor();
            contructor.Initialize();
            fillEntitiesDictionary();
        }
Beispiel #2
0
        void fillEntitiesDictionary()
        {
            foreach (var pair in alltemplates)
            {
                var components = new List <IComponent>();
                constructedEntities.Add(pair.Key, components);
                foreach (var comp in pair.Value.components)
                {
                    Type type = Type.GetType(comp.Key);
                    if (type == null)
                    {
                        continue;
                    }
                    IComponent icomp = ComponentFactory.MakeNew(type);

                    EntityConstructor.AssignFromTemplate(icomp, comp.Value);
                    components.Add(icomp);
                }
            }
        }