Beispiel #1
0
        public override void Build(MetaBuilder mb, bool isRoot = false)
        {
            this.MetaStructure.extensions = new Array_StructurePointer();

            // CBaseArchetypeDef + CMloArchetypeDef + CTimeArchetypeDef
            var archetypePtrs = new List <MetaPOINTER>();

            this.AddMetaPointers(mb, archetypePtrs, MetaName.CBaseArchetypeDef, this.Archetypes.Select(e => { e.Build(mb); return(e.MetaStructure); }));
            this.AddMetaPointers(mb, archetypePtrs, MetaName.CMloArchetypeDef, this.MloArchetypes.Select(e => { e.Build(mb); return(e.MetaStructure); }));
            this.AddMetaPointers(mb, archetypePtrs, MetaName.CTimeArchetypeDef, this.TimeArchetypes.Select(e => { e.Build(mb); return(e.MetaStructure); }));
            this.MetaStructure.archetypes = mb.AddPointerArray(archetypePtrs.ToArray());

            this.MetaStructure.name         = (uint)this.Name;
            this.MetaStructure.dependencies = mb.AddUintArrayPtr(this.Dependencies.ToArray());

            this.MetaStructure.compositeEntityTypes = mb.AddItemArrayPtr(MetaName.CCompositeEntityType, this.CompositeEntityTypes.Select(e => e.MetaStructure).ToArray());
            MCCompositeEntityType.AddEnumAndStructureInfo(mb);

            MCMapTypes.AddEnumAndStructureInfo(mb);

            if (isRoot)
            {
                mb.AddItem(this.MetaName, this.MetaStructure);

                this.Meta = mb.GetMeta();
            }
        }
Beispiel #2
0
        public override void Parse(object[] parameters = null)
        {
            var CMapTypesBlocks = this.ResourceFile.ResourceData.FindBlocks(MetaName.CMapTypes);

            if (CMapTypesBlocks.Length == 0)
            {
                throw new Exception("CMapTypes block not found !");
            }

            var CMapTypes = MetaUtils.ConvertData <CMapTypes>(CMapTypesBlocks[0]);

            this.CMapTypes = new MCMapTypes();

            this.CMapTypes.Parse(this.ResourceFile.ResourceData, CMapTypes);
        }
Beispiel #3
0
 public YtypFile()
 {
     this.CMapTypes = new MCMapTypes();
 }