public override void Write(BinaryWriter file) { base.Write(file); // Headers var vlqheader = new CArrayVLQInt32 <CString>(cr2w, null, "") { Elements = Headers.Elements }; vlqheader.Write(file); // Data var vlqdata = new CArrayVLQInt32 <CArrayVLQInt32 <CString> >(cr2w, null, ""); if (Data != null) { foreach (var dataElement in Data.Elements) { var datael = new CArrayVLQInt32 <CString>(cr2w, null, "") { Elements = dataElement.Elements }; vlqdata.Elements.Add(datael); } } vlqdata.Write(file); }
public CookedLootData(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { Key = new CUInt64(cr2w, this, nameof(Key)) { IsSerialized = true }; LootTableIds = new CArrayVLQInt32 <TweakDBID>(cr2w, this, nameof(LootTableIds)) { IsSerialized = true }; ContentAssignment = new TweakDBID(cr2w, this, nameof(ContentAssignment)) { IsSerialized = true }; }
public override void Read(BinaryReader file, uint size) { base.Read(file, size); // csv files have the same data as above but appended // and with VLQint-indexed arrays instead of uint32 // Headers var vlqheader = new CArrayVLQInt32 <CString>(cr2w, null, ""); vlqheader.Read(file, 0); // Data var vlqdata = new CArrayVLQInt32 <CArrayVLQInt32 <CString> >(cr2w, null, ""); vlqdata.Read(file, 0); }