internal OrdersBlockBase(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.style = binaryReader.ReadShortBlockIndex1(); this.invalidName_ = binaryReader.ReadBytes(2); this.flags = (Flags)binaryReader.ReadInt32(); this.forceCombatStatus = (ForceCombatStatus)binaryReader.ReadInt16(); this.invalidName_0 = binaryReader.ReadBytes(2); this.entryScript = binaryReader.ReadString32(); this.invalidName_1 = binaryReader.ReadBytes(2); this.followSquad = binaryReader.ReadShortBlockIndex1(); this.followRadius = binaryReader.ReadSingle(); this.primaryAreaSet = ReadZoneSetBlockArray(binaryReader); this.secondaryAreaSet = ReadSecondaryZoneSetBlockArray(binaryReader); this.secondarySetTrigger = ReadSecondarySetTriggerBlockArray(binaryReader); this.specialMovement = ReadSpecialMovementBlockArray(binaryReader); this.orderEndings = ReadOrderEndingBlockArray(binaryReader); }
public OrdersBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.style = binaryReader.ReadShortBlockIndex1(); this.padding = binaryReader.ReadBytes(2); this.flags = (Flags)binaryReader.ReadInt32(); this.forceCombatStatus = (ForceCombatStatus)binaryReader.ReadInt16(); this.padding0 = binaryReader.ReadBytes(2); this.entryScript = binaryReader.ReadString32(); this.skip1 = binaryReader.ReadBytes(2); this.followSquad = binaryReader.ReadShortBlockIndex1(); this.followRadius = binaryReader.ReadSingle(); { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(ZoneSetBlock)); this.primaryAreaSet = new ZoneSetBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.primaryAreaSet[i] = new ZoneSetBlock(binaryReader); } } } { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(SecondaryZoneSetBlock)); this.secondaryAreaSet = new SecondaryZoneSetBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.secondaryAreaSet[i] = new SecondaryZoneSetBlock(binaryReader); } } } { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(SecondarySetTriggerBlock)); this.secondarySetTrigger = new SecondarySetTriggerBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.secondarySetTrigger[i] = new SecondarySetTriggerBlock(binaryReader); } } } { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(SpecialMovementBlock)); this.specialMovement = new SpecialMovementBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.specialMovement[i] = new SpecialMovementBlock(binaryReader); } } } { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(OrderEndingBlock)); this.orderEndings = new OrderEndingBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.orderEndings[i] = new OrderEndingBlock(binaryReader); } } } }