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 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 "OBND": OBND = new OBNDSubRecord(); OBND.Deserialize(stream, name); break; case "MODL": MODL = new STRSubRecord(); MODL.Deserialize(stream, name); break; case "ACBS": ACBS = new ACBSSubRecord(); ACBS.Deserialize(stream, name); break; case "SNAM": var snam = new SNAMSubRecord(); snam.Deserialize(stream, name); SNAM.Add(snam); break; case "INAM": INAM = new FormID(); INAM.Deserialize(stream, name); break; case "VTCK": VTCK = new FormID(); VTCK.Deserialize(stream, name); break; case "TPLT": TPLT = new FormID(); TPLT.Deserialize(stream, name); break; case "RNAM": RNAM = new FormID(); RNAM.Deserialize(stream, name); break; case "EITM": EITM = new FormID(); EITM.Deserialize(stream, name); break; case "SCRI": SCRI = new FormID(); SCRI.Deserialize(stream, name); break; case "PKID": var pkid = new FormID(); pkid.Deserialize(stream, name); PKID.Add(pkid); break; case "CNAM": CNAM = new FormID(); CNAM.Deserialize(stream, name); break; case "PNAM": var pnam = new FormID(); pnam.Deserialize(stream, name); PNAM.Add(pnam); break; case "HNAM": HNAM = new FormID(); HNAM.Deserialize(stream, name); break; case "ENAM": ENAM = new FormID(); ENAM.Deserialize(stream, name); break; case "ZNAM": ZNAM = new FormID(); ZNAM.Deserialize(stream, name); break; default: var rest = stream.ReadUInt16(); stream.ReadBytes(rest); break; } } } }