public override void ReadData(ESPReader reader, long dataEnd) { while (reader.BaseStream.Position < dataEnd) { string subTag = reader.PeekTag(); switch (subTag) { case "EDID": if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadBinary(reader); break; case "PKDT": if (Data == null) { Data = new PackageData(); } Data.ReadBinary(reader); break; case "PLDT": if (Location1 == null) { Location1 = new PackageLocation(); } Location1.ReadBinary(reader); break; case "PLD2": if (Location2 == null) { Location2 = new PackageLocation(); } Location2.ReadBinary(reader); break; case "PSDT": if (Schedule == null) { Schedule = new PackageScheduleData(); } Schedule.ReadBinary(reader); break; case "PTDT": if (Target1 == null) { Target1 = new PackageTarget(); } Target1.ReadBinary(reader); break; case "CTDA": if (Conditions == null) { Conditions = new List <Condition>(); } Condition tempCTDA = new Condition(); tempCTDA.ReadBinary(reader); Conditions.Add(tempCTDA); break; case "IDLF": if (IdleFlags == null) { IdleFlags = new SimpleSubrecord <PackageIdleFlags>(); } IdleFlags.ReadBinary(reader); break; case "IDLC": if (IdleCount == null) { IdleCount = new SimpleSubrecord <Byte>(); } IdleCount.ReadBinary(reader); break; case "IDLT": if (IdleTimerSetting == null) { IdleTimerSetting = new SimpleSubrecord <Single>(); } IdleTimerSetting.ReadBinary(reader); break; case "IDLA": if (IdleAnimations == null) { IdleAnimations = new FormArray(); } IdleAnimations.ReadBinary(reader); break; case "IDLB": if (Unused == null) { Unused = new SimpleSubrecord <Byte[]>(); } Unused.ReadBinary(reader); break; case "CNAM": if (CombatStyle == null) { CombatStyle = new RecordReference(); } CombatStyle.ReadBinary(reader); break; case "PKED": if (EatMarker == null) { EatMarker = new SubMarker(); } EatMarker.ReadBinary(reader); break; case "PKE2": if (EscortDistance == null) { EscortDistance = new SimpleSubrecord <UInt32>(); } EscortDistance.ReadBinary(reader); break; case "PKFD": if (FollowDistance_StartLocation_TriggerRadius == null) { FollowDistance_StartLocation_TriggerRadius = new SimpleSubrecord <UInt32>(); } FollowDistance_StartLocation_TriggerRadius.ReadBinary(reader); break; case "PKPT": if (PatrolIsRepeatable == null) { PatrolIsRepeatable = new SimpleSubrecord <NoYesByte>(); } PatrolIsRepeatable.ReadBinary(reader); break; case "PKW3": if (UseWeaponData == null) { UseWeaponData = new PackageUseWeaponData(); } UseWeaponData.ReadBinary(reader); break; case "PTD2": if (Target2 == null) { Target2 = new PackageTarget(); } Target2.ReadBinary(reader); break; case "PUID": if (UseItemMarker == null) { UseItemMarker = new SubMarker(); } UseItemMarker.ReadBinary(reader); break; case "PKAM": if (AmbushMarker == null) { AmbushMarker = new SubMarker(); } AmbushMarker.ReadBinary(reader); break; case "PKDD": if (DialogData == null) { DialogData = new PackageDialogData(); } DialogData.ReadBinary(reader); break; case "DUMY": if (DummyIgnore == null) { DummyIgnore = new PackageLocation(); } DummyIgnore.ReadBinary(reader); break; case "POBA": if (OnBegin == null) { OnBegin = new PackageEvent(); } OnBegin.ReadBinary(reader); break; case "POEA": if (OnEnd == null) { OnEnd = new PackageEvent(); } OnEnd.ReadBinary(reader); break; case "POCA": if (OnChange == null) { OnChange = new PackageEvent(); } OnChange.ReadBinary(reader); break; default: throw new Exception(); } } }