private static ExtractedSoundPromotion ReadSoundPromotion(IReader reader, byte version) { if (version > 0) { throw new InvalidOperationException("Unrecognized \"spro\" block version"); } int originalIndex = reader.ReadInt32(); SoundPromotion promo = new SoundPromotion(); promo.ActivePromotionIndex = reader.ReadInt32(); promo.LastPromotionTime = reader.ReadInt32(); promo.SuppressionTimeout = reader.ReadInt32(); var rules = new System.Collections.Generic.List <SoundPromotionRule>(); int rulecount = reader.ReadInt32(); for (int i = 0; i < rulecount; i++) { SoundPromotionRule rule = new SoundPromotionRule(); rule.LocalPitchRangeIndex = reader.ReadInt32(); rule.MaximumPlayCount = reader.ReadInt32(); rule.SupressionTime = reader.ReadFloat(); rule.RolloverTime = reader.ReadInt32(); rule.ImpulseTime = reader.ReadInt32(); rules.Add(rule); } promo.Rules = rules.ToArray(); return(new ExtractedSoundPromotion(originalIndex, promo)); }
public ExtractedSoundPromotion(int index, SoundPromotion src) { OriginalIndex = index; Source = src; }