internal static void Read(int version, BinaryReader br, AWARD_RATIO_SCALE AWARD_RATIO_SCALE) { AWARD_RATIO_SCALE.m_ulScales = br.ReadInt32(); int ratios_count = GlobalFunctions.GetMaxAwardScales(version); for (int i = 0; i < ratios_count; i++) { AWARD_RATIO_SCALE.m_Ratios[i] = br.ReadSingle(); } AWARD_RATIO_SCALE.m_Awards = new AWARD_DATA[AWARD_RATIO_SCALE.m_ulScales]; for (int i = 0; i < AWARD_RATIO_SCALE.m_ulScales; i++) { AWARD_RATIO_SCALE.m_Awards[i] = new AWARD_DATA(); AWARD_DATA.Read(version, br, AWARD_RATIO_SCALE.m_Awards[i]); } }
internal static void Write(int version, BinaryWriter bw, AWARD_RATIO_SCALE AWARD_RATIO_SCALE) { int ratios_count = GlobalFunctions.GetMaxAwardScales(version); if (AWARD_RATIO_SCALE.m_ulScales > ratios_count) { bw.Write(ratios_count); } else { bw.Write(AWARD_RATIO_SCALE.m_ulScales); } for (int i = 0; i < ratios_count; i++) { bw.Write(AWARD_RATIO_SCALE.m_Ratios[i]); } for (int i = 0; i < AWARD_RATIO_SCALE.m_ulScales && i < ratios_count; i++) { AWARD_DATA.Write(version, bw, AWARD_RATIO_SCALE.m_Awards[i]); } }