Beispiel #1
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "DATA":
                    if (CellFlags == null)
                    {
                        CellFlags = new SimpleSubrecord <CellFlags>();
                    }

                    CellFlags.ReadBinary(reader);
                    break;

                case "XCLC":
                    if (Grid == null)
                    {
                        Grid = new CellGrid();
                    }

                    Grid.ReadBinary(reader);
                    break;

                case "XCLL":
                    if (Lighting == null)
                    {
                        Lighting = new CellLighting();
                    }

                    Lighting.ReadBinary(reader);
                    break;

                case "IMPF":
                    if (FootstepMaterial == null)
                    {
                        FootstepMaterial = new FootstepMaterial();
                    }

                    FootstepMaterial.ReadBinary(reader);
                    break;

                case "LTMP":
                    if (LightTemplate == null)
                    {
                        LightTemplate = new RecordReference();
                    }

                    LightTemplate.ReadBinary(reader);
                    break;

                case "LNAM":
                    if (LightTemplateInherit == null)
                    {
                        LightTemplateInherit = new SimpleSubrecord <LightTemplateInheritFlags>();
                    }

                    LightTemplateInherit.ReadBinary(reader);
                    break;

                case "XCLW":
                    if (WaterHeight == null)
                    {
                        WaterHeight = new SimpleSubrecord <Single>();
                    }

                    WaterHeight.ReadBinary(reader);
                    break;

                case "XNAM":
                    if (WaterNoiseTexture == null)
                    {
                        WaterNoiseTexture = new SimpleSubrecord <String>();
                    }

                    WaterNoiseTexture.ReadBinary(reader);
                    break;

                case "XCLR":
                    if (Regions == null)
                    {
                        Regions = new SortedFormArray();
                    }

                    Regions.ReadBinary(reader);
                    break;

                case "XCIM":
                    if (ImageSpace == null)
                    {
                        ImageSpace = new RecordReference();
                    }

                    ImageSpace.ReadBinary(reader);
                    break;

                case "XCET":
                    if (Unknown == null)
                    {
                        Unknown = new SimpleSubrecord <Byte>();
                    }

                    Unknown.ReadBinary(reader);
                    break;

                case "XEZN":
                    if (EncounterZone == null)
                    {
                        EncounterZone = new RecordReference();
                    }

                    EncounterZone.ReadBinary(reader);
                    break;

                case "XCCM":
                    if (Climate == null)
                    {
                        Climate = new RecordReference();
                    }

                    Climate.ReadBinary(reader);
                    break;

                case "XCWT":
                    if (Water == null)
                    {
                        Water = new RecordReference();
                    }

                    Water.ReadBinary(reader);
                    break;

                case "XOWN":
                    if (Owner == null)
                    {
                        Owner = new RecordReference();
                    }

                    Owner.ReadBinary(reader);
                    break;

                case "XRNK":
                    if (FactionRank == null)
                    {
                        FactionRank = new SimpleSubrecord <Int32>();
                    }

                    FactionRank.ReadBinary(reader);
                    break;

                case "XCAS":
                    if (AcousticSpace == null)
                    {
                        AcousticSpace = new RecordReference();
                    }

                    AcousticSpace.ReadBinary(reader);
                    break;

                case "XCMT":
                    if (Unused == null)
                    {
                        Unused = new SimpleSubrecord <Byte>();
                    }

                    Unused.ReadBinary(reader);
                    break;

                case "XCMO":
                    if (MusicType == null)
                    {
                        MusicType = new RecordReference();
                    }

                    MusicType.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "XEZN":
                    if (EncounterZone == null)
                    {
                        EncounterZone = new RecordReference();
                    }

                    EncounterZone.ReadBinary(reader);
                    break;

                case "WNAM":
                    if (ParentWorldspace == null)
                    {
                        ParentWorldspace = new RecordReference();
                    }

                    ParentWorldspace.ReadBinary(reader);
                    break;

                case "PNAM":
                    if (ParentWorldspaceFlags == null)
                    {
                        ParentWorldspaceFlags = new SimpleSubrecord <ParentWorldspaceFlags>();
                    }

                    ParentWorldspaceFlags.ReadBinary(reader);
                    break;

                case "CNAM":
                    if (Climate == null)
                    {
                        Climate = new RecordReference();
                    }

                    Climate.ReadBinary(reader);
                    break;

                case "NAM2":
                    if (Water == null)
                    {
                        Water = new RecordReference();
                    }

                    Water.ReadBinary(reader);
                    break;

                case "NAM3":
                    if (LODWaterType == null)
                    {
                        LODWaterType = new RecordReference();
                    }

                    LODWaterType.ReadBinary(reader);
                    break;

                case "NAM4":
                    if (LODWaterHeight == null)
                    {
                        LODWaterHeight = new SimpleSubrecord <Single>();
                    }

                    LODWaterHeight.ReadBinary(reader);
                    break;

                case "DNAM":
                    if (LandData == null)
                    {
                        LandData = new WorldLandData();
                    }

                    LandData.ReadBinary(reader);
                    break;

                case "ICON":
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "MNAM":
                    if (MapData == null)
                    {
                        MapData = new MapData();
                    }

                    MapData.ReadBinary(reader);
                    break;

                case "ONAM":
                    if (WorldMapOffsetData == null)
                    {
                        WorldMapOffsetData = new WorldMapOffsetData();
                    }

                    WorldMapOffsetData.ReadBinary(reader);
                    break;

                case "INAM":
                    if (ImageSpace == null)
                    {
                        ImageSpace = new RecordReference();
                    }

                    ImageSpace.ReadBinary(reader);
                    break;

                case "DATA":
                    if (WorldspaceFlags == null)
                    {
                        WorldspaceFlags = new SimpleSubrecord <WorldspaceFlags>();
                    }

                    WorldspaceFlags.ReadBinary(reader);
                    break;

                case "NAM0":
                    if (MinObjectBounds == null)
                    {
                        MinObjectBounds = new SimpleSubrecord <XYFloat>();
                    }

                    MinObjectBounds.ReadBinary(reader);
                    break;

                case "NAM9":
                    if (MaxObjectBounds == null)
                    {
                        MaxObjectBounds = new SimpleSubrecord <XYFloat>();
                    }

                    MaxObjectBounds.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (Music == null)
                    {
                        Music = new RecordReference();
                    }

                    Music.ReadBinary(reader);
                    break;

                case "NNAM":
                    if (CanopyShadow == null)
                    {
                        CanopyShadow = new SimpleSubrecord <String>();
                    }

                    CanopyShadow.ReadBinary(reader);
                    break;

                case "XNAM":
                    if (WaterNoiseTexture == null)
                    {
                        WaterNoiseTexture = new SimpleSubrecord <String>();
                    }

                    WaterNoiseTexture.ReadBinary(reader);
                    break;

                case "IMPS":
                    if (SwappedImpacts == null)
                    {
                        SwappedImpacts = new List <SwappedImpact>();
                    }

                    SwappedImpact tempIMPS = new SwappedImpact();
                    tempIMPS.ReadBinary(reader);
                    SwappedImpacts.Add(tempIMPS);
                    break;

                case "IMPF":
                    if (FootstepMaterial == null)
                    {
                        FootstepMaterial = new FootstepMaterial();
                    }

                    FootstepMaterial.ReadBinary(reader);
                    break;

                case "XXXX":
                    if (OffsetDataSize == null)
                    {
                        OffsetDataSize = new SimpleSubrecord <UInt32>();
                    }

                    OffsetDataSize.ReadBinary(reader);
                    break;

                case "OFST":
                    ReadOffsetData(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }