public static void Write(Stream stream, Ite ite) { BinaryMapping.WriteObject <Header>(stream, ite.header); // Weapon. for (int i = 0; i < ite.header.WeaponDataCount; i++) { BinaryMapping.WriteObject <ITEData>(stream, ite.WeaponList[i]); } // Flavor. for (int i = 0; i < ite.header.FlavorDataCount; i++) { BinaryMapping.WriteObject <ITEData>(stream, ite.FlavorList[i]); } // Key Item. for (int i = 0; i < ite.header.KeyItemDataCount; i++) { BinaryMapping.WriteObject <ITEData>(stream, ite.KeyItemList[i]); } // Key Item Hide. for (int i = 0; i < ite.header.KeyItemHideDataCount; i++) { BinaryMapping.WriteObject <ITEData>(stream, ite.KeyItemHideList[i]); } // Synthesis. for (int i = 0; i < ite.header.SynthesisDataCount; i++) { BinaryMapping.WriteObject <ITEData>(stream, ite.SynthesisList[i]); } }
public static Ite Read(Stream stream) { Ite ite = new Ite(); ite.header = BinaryMapping.ReadObject <Header>(stream); // Weapon. for (int i = 0; i < ite.header.WeaponDataCount; i++) { ite.WeaponList.Add(BinaryMapping.ReadObject <ITEData>(stream)); } // Flavor. for (int i = 0; i < ite.header.FlavorDataCount; i++) { ite.FlavorList.Add(BinaryMapping.ReadObject <ITEData>(stream)); } // Key Item. for (int i = 0; i < ite.header.KeyItemDataCount; i++) { ite.KeyItemList.Add(BinaryMapping.ReadObject <ITEData>(stream)); } // Key Item Hide. for (int i = 0; i < ite.header.KeyItemHideDataCount; i++) { ite.KeyItemHideList.Add(BinaryMapping.ReadObject <ITEData>(stream)); } // Synthesis. for (int i = 0; i < ite.header.SynthesisDataCount; i++) { ite.SynthesisList.Add(BinaryMapping.ReadObject <ITEData>(stream)); } return(ite); }