protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size) { var bytes = reader.ReadBytes((int)size); var name = string.Empty; using (var stream = new BetterMemoryReader(bytes)) { var end = stream.Length; while (stream.Position < end) { name = stream.ReadString(4); switch (name) { case "EDID": EDID = new STRSubRecord(); EDID.Deserialize(stream, name); break; case "OBND": OBND = new OBNDSubRecord(); OBND.Deserialize(stream, name); break; case "MODL": MODL = new STRSubRecord(); MODL.Deserialize(stream, name); break; case "MODB": MODB = new BytesSubRecord(); MODB.Deserialize(stream, name); break; case "MODT": MODT = new BytesSubRecord(); MODT.Deserialize(stream, name); break; case "MODS": MODS = new MODSSubRecord(); MODS.Deserialize(stream, name); break; case "MODD": MODD = new MODDSubRecord(); MODD.Deserialize(stream, name); break; default: var rest = stream.ReadUInt16(); stream.ReadBytes(rest); break; } } } }
protected override void ExtractSubRecords(BetterReader reader, GameID gameId, uint size) { var endRead = reader.Position + size; var name = string.Empty; while (reader.Position < endRead) { name = reader.ReadString(4); switch (name) { case "HEDR": Header = new HEDRSubRecord(); Header.Deserialize(reader, name); break; case "OFST": Offset = new BytesSubRecord(); Offset.Deserialize(reader, name); break; case "DELE": DELE = new BytesSubRecord(); DELE.Deserialize(reader, name); break; case "CNAM": Author = new STRSubRecord(); Author.Deserialize(reader, name); break; case "SNAM": Description = new STRSubRecord(); Description.Deserialize(reader, name); break; case "MAST": Master = new STRSubRecord(); Master.Deserialize(reader, name); break; case "DATA": FileSize = new UInt64SubRecord(); FileSize.Deserialize(reader, name); break; default: var dSize = reader.ReadInt16(); reader.ReadBytes(dSize); break; } } }
protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size) { var bytes = reader.ReadBytes((int)size); var name = string.Empty; using (var stream = new BetterMemoryReader(bytes)) { var end = stream.Length; while (stream.Position < end) { name = stream.ReadString(4); switch (name) { case "EDID": EDID = new STRSubRecord(); EDID.Deserialize(stream, name); break; case "FULL": FULL = new STRSubRecord(); FULL.Deserialize(stream, name); break; case "DATA": DATA = new CELL_DATASubRecord(); DATA.Deserialize(stream, name); break; case "XCLL": XCLL = new BytesSubRecord(); XCLL.Deserialize(stream, name); break; case "XCMT": XCMT = new ByteSubRecord(); XCMT.Deserialize(stream, name); break; case "XGLB": XGLB = new UInt32SubRecord(); XGLB.Deserialize(stream, name); break; case "XRNK": XRNK = new UInt32SubRecord(); XRNK.Deserialize(stream, name); break; case "XCLW": XCLW = new FloatSubRecord(); XCLW.Deserialize(stream, name); break; case "XCLC": XCLC = new Vector2iSubRecord(); XCLC.Deserialize(stream, name); break; case "XCLR": XCLR = new FormID(); XCLR.Deserialize(stream, name); break; case "XCIM": XCIM = new FormID(); XCIM.Deserialize(stream, name); break; case "XEZN": XEZN = new FormID(); XEZN.Deserialize(stream, name); break; case "XCCM": XCCM = new FormID(); XCCM.Deserialize(stream, name); break; case "XCWT": XCWT = new FormID(); XCWT.Deserialize(stream, name); break; case "XOWN": XOWN = new FormID(); XOWN.Deserialize(stream, name); break; case "XCAS": XCAS = new FormID(); XCAS.Deserialize(stream, name); break; case "XCMO": XCMO = new FormID(); XCMO.Deserialize(stream, name); break; default: var rest = stream.ReadUInt16(); stream.ReadBytes(rest); break; } } } }
protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size) { var bytes = reader.ReadBytes((int)size); var name = string.Empty; using (var stream = new BetterMemoryReader(bytes)) { var end = stream.Length; while (stream.Position < end) { name = stream.ReadString(4); switch (name) { case "EDID": EDID = new STRSubRecord(); EDID.Deserialize(stream, name); break; case "NAME": NAME = new FormID(); NAME.Deserialize(stream, name); break; case "XLOC": XLOC = new REFR_XLOCSubRecord(); XLOC.Deserialize(stream, name); break; case "XOWN": XOWN = new FormID(); XOWN.Deserialize(stream, name); break; case "XLKR": XLKR = new FormID(); XLKR.Deserialize(stream, name); break; case "DATA": DATA = new PosAndRotSubRecord(); DATA.Deserialize(stream, name); break; case "XSCL": XSCL = new FloatSubRecord(); XSCL.Deserialize(stream, name); break; case "XTEL": XTEL = new REFR_XTELSubRecord(); XTEL.Deserialize(stream, name); break; case "XNDP": XNDP = new REFR_XNDPSubRecord(); XNDP.Deserialize(stream, name); break; case "XLTW": XLTW = new FormID(); XLTW.Deserialize(stream, name); break; case "XRDS": XRDS = new FloatSubRecord(); XRDS.Deserialize(stream, name); break; case "XEMI": XEMI = new FormID(); XEMI.Deserialize(stream, name); break; case "XPWR": var xpwr = new REFR_XPWRSubRecord(); xpwr.Deserialize(stream, name); XPWR.Add(xpwr); break; case "XPRD": XPRD = new FloatSubRecord(); XPRD.Deserialize(stream, name); break; case "XPPA": var xppaSize = stream.ReadUInt16(); var xppaData = stream.ReadBytes(Convert.ToInt32(xppaSize)); XPPA = true; if (xppaData.Length > 0) { break; } break; case "INAM": INAM = new FormID(); INAM.Deserialize(stream, name); break; case "SCHR": SCHR = new SCHRSubRecord(); SCHR.Deserialize(stream, name); break; case "TNAM": TNAM = new BytesSubRecord(); TNAM.Deserialize(stream, name); break; case "XMBO": XMBO = new REFR_XMBOSubRecord(); XMBO.Deserialize(stream, name); break; case "XPRM": XPRM = new REFR_XPRMSubRecord(); XPRM.Deserialize(stream, name); break; case "XRMR": XRMR = new REFR_XRMRSubRecord(); XRMR.Deserialize(stream, name); break; case "XLRM": XLRM = new FormID(); XLRM.Deserialize(stream, name); break; case "XACT": XACT = new REFR_XACTSubRecord(); XACT.Deserialize(stream, name); break; case "ONAM": var onamSize = stream.ReadUInt16(); var onamData = stream.ReadBytes(Convert.ToInt32(onamSize)); ONAM = true; if (onamData.Length > 0) { break; } break; case "XRGD": XRGD = new BytesSubRecord(); XRGD.Deserialize(stream, name); break; case "XHLP": XHLP = new FloatSubRecord(); XHLP.Deserialize(stream, name); break; case "XSED": XSED = new ByteSubRecord(); XSED.Deserialize(stream, name); break; case "XPOD": XPOD = new REFR_XPODSubRecord(); XPOD.Deserialize(stream, name); break; case "XRDO": XRDO = new REFR_XRDOSubRecord(); XRDO.Deserialize(stream, name); break; case "XAPD": XAPD = new ByteSubRecord(); XAPD.Deserialize(stream, name); break; case "XAPR": var xapr = new REFR_XAPRSubRecord(); xapr.Deserialize(stream, name); XAPR.Add(xapr); if (XAPR.Count > 1) { break; } break; case "XESP": XESP = new REFR_XESPSubRecord(); XESP.Deserialize(stream, name); break; case "XLCM": XLCM = new UInt32SubRecord(); XLCM.Deserialize(stream, name); break; case "XCNT": XCNT = new UInt32SubRecord(); XCNT.Deserialize(stream, name); break; case "XTRI": XTRI = new REFR_XTRISubRecord(); XTRI.Deserialize(stream, name); break; case "XOCP": XOCP = new BytesSubRecord(); XOCP.Deserialize(stream, name); break; case "XAMT": XAMT = new FormID(); XAMT.Deserialize(stream, name); break; case "XAMC": XAMC = new UInt32SubRecord(); XAMC.Deserialize(stream, name); break; case "XRAD": XRAD = new FloatSubRecord(); XRAD.Deserialize(stream, name); break; case "XIBS": var xibsSize = stream.ReadUInt16(); var xibsData = stream.ReadBytes(xibsSize); XIBS = true; break; case "XTRG": XTRG = new FormID(); XTRG.Deserialize(stream, name); break; case "XORD": XORD = new BytesSubRecord(); XORD.Deserialize(stream, name); break; case "XMBP": var xmbpSize = stream.ReadUInt16(); var xmbpData = stream.ReadBytes(xmbpSize); XMBP = true; break; case "XMBR": XMBR = new FormID(); XMBR.Deserialize(stream, name); break; case "XCLP": XCLP = new BytesSubRecord(); XCLP.Deserialize(stream, name); break; case "XMRK": var xmrkSize = stream.ReadUInt16(); var xmrkData = stream.ReadBytes(xmrkSize); XMRK = true; break; case "FNAM": FNAM = new REFR_FNAMSubRecord(); FNAM.Deserialize(stream, name); break; case "FULL": FULL = new STRSubRecord(); FULL.Deserialize(stream, name); break; case "SCDA": SCDA = new BytesSubRecord(); SCDA.Deserialize(stream, name); break; case "SCRO": SCRO = new BytesSubRecord(); SCRO.Deserialize(stream, name); break; case "XLOD": XLOD = new BytesSubRecord(); XLOD.Deserialize(stream, name); break; case "RCLR": RCLR = new BytesSubRecord(); RCLR.Deserialize(stream, name); break; case "XRGB": XRGB = new BytesSubRecord(); XRGB.Deserialize(stream, name); break; default: var rest = stream.ReadUInt16(); stream.ReadBytes(rest); break; } } } }
protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size) { var bytes = reader.ReadBytes((int)size); var name = string.Empty; using (var stream = new BetterMemoryReader(bytes)) { var end = stream.Length; while (stream.Position < end) { name = stream.ReadString(4); switch (name) { case "DATA": DATA = new BytesSubRecord(); DATA.Deserialize(stream, name); break; case "VNML": VNML = new VNMLorVCLRSubRecord(); VNML.Deserialize(stream, name); break; case "VCLR": VCLR = new VNMLorVCLRSubRecord(); VCLR.Deserialize(stream, name); break; case "VHGT": VHGT = new VHGTSubRecord(); VHGT.Deserialize(stream, name); break; case "BTXT": var btxt = new ATXTorBTXTSubRecord(); btxt.Deserialize(stream, name); BTXT.Add(btxt); if (BTXT.Count > 1) { break; } break; case "ATXT": var atxt = new ATXTorBTXTSubRecord(); atxt.Deserialize(stream, name); ATXT.Add(atxt); if (ATXT.Count > 1) { break; } break; case "VTXT": var vtxt = new VTXTSubRecord(); vtxt.Deserialize(stream, name); VTXT.Add(vtxt); if (VTXT.Count > 1) { break; } break; default: var rest = stream.ReadUInt16(); stream.ReadBytes(rest); break; } } } }