Пример #1
0
        public override void Build(MetaBuilder mb, bool isRoot = false)
        {
            this.MetaStructure.archetypeName = this.ArchetypeName;
            this.MetaStructure.flags         = this.Flags;
            this.MetaStructure.guid          = this.Guid;
            this.MetaStructure.position      = this.Position;
            this.MetaStructure.rotation      = this.Rotation;
            this.MetaStructure.scaleXY       = this.ScaleXY;
            this.MetaStructure.scaleZ        = this.ScaleZ;
            this.MetaStructure.parentIndex   = this.ParentIndex;
            this.MetaStructure.lodDist       = this.LodDist;
            this.MetaStructure.childLodDist  = this.ChildLodDist;
            this.MetaStructure.lodLevel      = this.LodLevel;
            this.MetaStructure.numChildren   = this.NumChildren;
            this.MetaStructure.priorityLevel = this.PriorityLevel;
            this.MetaStructure.extensions    = this.Extensions;
            this.MetaStructure.ambientOcclusionMultiplier = this.AmbientOcclusionMultiplier;
            this.MetaStructure.artificialAmbientOcclusion = this.ArtificialAmbientOcclusion;
            this.MetaStructure.tintValue         = this.TintValue;
            this.MetaStructure.groupId           = this.GroupId;
            this.MetaStructure.floorId           = this.FloorId;
            this.MetaStructure.defaultEntitySets = this.DefaultEntitySets;
            this.MetaStructure.numExitPortals    = this.NumExitPortals;
            this.MetaStructure.MLOInstflags      = this.MLOInstflags;

            MCMloInstanceDef.AddEnumAndStructureInfo(mb);

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

                this.Meta = mb.GetMeta();
            }
        }
Пример #2
0
        public void ParseFast(MetaFile meta, CMapData CMapData)
        {
            this.Meta          = meta;
            this.MetaStructure = CMapData;

            this.Name                = (MetaName)CMapData.name;
            this.Parent              = (MetaName)CMapData.parent;
            this.Flags               = CMapData.flags;
            this.ContentFlags        = CMapData.contentFlags;
            this.StreamingExtentsMin = CMapData.streamingExtentsMin;
            this.StreamingExtentsMax = CMapData.streamingExtentsMax;
            this.EntitiesExtentsMin  = CMapData.entitiesExtentsMin;
            this.EntitiesExtentsMax  = CMapData.entitiesExtentsMax;

            this.Entities = MetaUtils.GetTypedDataArray <CEntityDef>(this.Meta, MetaName.CEntityDef)?.Select(e => { var obj = new MCEntityDef(this); obj.ParseWithoutExtensions(meta, e); return(obj); }).ToList() ?? new List <MCEntityDef>();

            this.MloInstances = MetaUtils.GetTypedDataArray <CMloInstanceDef>(this.Meta, MetaName.CMloInstanceDef)?.Select(e => { var obj = new MCMloInstanceDef(); obj.Parse(meta, e); return(obj); }).ToList() ?? new List <MCMloInstanceDef>();

            this.Block = new MCBlockDesc();
            this.Block.Parse(meta, CMapData.block);
        }
Пример #3
0
        public override void Parse(MetaFile meta, CMapData CMapData)
        {
            this.Meta          = meta;
            this.MetaStructure = CMapData;

            this.Name                = (MetaName)CMapData.name;
            this.Parent              = (MetaName)CMapData.parent;
            this.Flags               = CMapData.flags;
            this.ContentFlags        = CMapData.contentFlags;
            this.StreamingExtentsMin = CMapData.streamingExtentsMin;
            this.StreamingExtentsMax = CMapData.streamingExtentsMax;
            this.EntitiesExtentsMin  = CMapData.entitiesExtentsMin;
            this.EntitiesExtentsMax  = CMapData.entitiesExtentsMax;

            this.Entities = MetaUtils.GetTypedDataArray <CEntityDef>(this.Meta, MetaName.CEntityDef)?.Select(e => { var obj = new MCEntityDef(this); obj.Parse(meta, e); return(obj); }).ToList() ?? new List <MCEntityDef>();

            this.MloInstances = MetaUtils.GetTypedDataArray <CMloInstanceDef>(this.Meta, MetaName.CMloInstanceDef)?.Select(e => { var obj = new MCMloInstanceDef(); obj.Parse(meta, e); return(obj); }).ToList() ?? new List <MCMloInstanceDef>();

            this.ContainerLods = new Array_Structure();
            var boxOccluders = MetaUtils.ConvertDataArray <Unk_975711773>(meta, CMapData.boxOccluders);

            this.BoxOccluders = boxOccluders?.Select(e => { var msw = new MUnk_975711773(); msw.Parse(meta, e); return(msw); }).ToList();

            var occludeModels = MetaUtils.ConvertDataArray <Unk_2741784237>(meta, CMapData.occludeModels);

            this.OccludeModels = occludeModels?.Select(e => { var msw = new MUnk_2741784237(); msw.Parse(meta, e); return(msw); }).ToList();

            this.PhysicsDictionaries = CMapData.physicsDictionaries;
            this.InstancedData       = new Mrage__fwInstancedMapData();
            this.InstancedData.Parse(meta, CMapData.instancedData);


            var timeCycleModifiers = MetaUtils.ConvertDataArray <CTimeCycleModifier>(meta, CMapData.timeCycleModifiers);

            this.TimeCycleModifiers = timeCycleModifiers?.Select(e => { var msw = new MCTimeCycleModifier(); msw.Parse(meta, e); return(msw); }).ToList();


            var carGenerators = MetaUtils.ConvertDataArray <CCarGen>(meta, CMapData.carGenerators);

            this.CarGenerators = carGenerators?.Select(e => { var msw = new MCCarGen(); msw.Parse(meta, e); return(msw); }).ToList();

            this.LODLightsSOA = new MCLODLight();
            this.LODLightsSOA.Parse(meta, CMapData.LODLightsSOA);
            this.DistantLODLightsSOA = new MCDistantLODLight();
            this.DistantLODLightsSOA.Parse(meta, CMapData.DistantLODLightsSOA);
            this.Block = new MCBlockDesc();
            this.Block.Parse(meta, CMapData.block);
        }