partial void ReadDamage(ESPReader reader) { var tag = reader.ReadTag(); var size = reader.ReadUInt16(); reader.BaseStream.Seek(-6, SeekOrigin.Current); if (size == 2) { Damage = new SimpleSubrecord <ushort>(); Damage.ReadBinary(reader); } else { Data = new WaterData(); Data.ReadBinary(reader); Data.Tag = "DNAM"; reader.BaseStream.Seek(-2, SeekOrigin.Current); Damage = new SimpleSubrecord <ushort>(); Damage.Tag = "DATA"; Damage.Value = reader.ReadUInt16(); } }
partial void ReadOffsetData(ESPReader reader) { OffsetData = new SimpleSubrecord <byte[]>(); if (OffsetDataSize == null) { OffsetData.ReadBinary(reader); } else { OffsetData.Tag = reader.ReadTag(); reader.ReadUInt16(); OffsetData.Value = reader.ReadBytes((int)OffsetDataSize.Value); } }
protected override void ReadData(ESPReader reader) { int readSize = size; if (size == 0) { reader.BaseStream.Seek(-16, SeekOrigin.Current); if (reader.ReadTag() == "XXXX") { Debug.Assert(reader.ReadUInt16() == 4); readSize = reader.ReadInt32(); reader.BaseStream.Seek(6, SeekOrigin.Current); } else { reader.BaseStream.Seek(12, SeekOrigin.Current); } } Data = reader.ReadBytes(readSize); }