internal SquadsBlockBase(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.flags = (Flags)binaryReader.ReadInt32(); this.team = (Team)binaryReader.ReadInt16(); this.parent = binaryReader.ReadShortBlockIndex1(); this.squadDelayTimeSeconds = binaryReader.ReadSingle(); this.normalDiffCount = binaryReader.ReadInt16(); this.insaneDiffCount = binaryReader.ReadInt16(); this.majorUpgrade = (MajorUpgrade)binaryReader.ReadInt16(); this.invalidName_ = binaryReader.ReadBytes(2); this.vehicleType = binaryReader.ReadShortBlockIndex1(); this.characterType = binaryReader.ReadShortBlockIndex1(); this.initialZone = binaryReader.ReadShortBlockIndex1(); this.invalidName_0 = binaryReader.ReadBytes(2); this.initialWeapon = binaryReader.ReadShortBlockIndex1(); this.initialSecondaryWeapon = binaryReader.ReadShortBlockIndex1(); this.grenadeType = (GrenadeType)binaryReader.ReadInt16(); this.initialOrder = binaryReader.ReadShortBlockIndex1(); this.vehicleVariant = binaryReader.ReadStringID(); this.startingLocations = ReadActorStartingLocationsBlockArray(binaryReader); this.placementScript = binaryReader.ReadString32(); this.invalidName_1 = binaryReader.ReadBytes(2); this.invalidName_2 = binaryReader.ReadBytes(2); }
public SquadsBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.flags = (Flags)binaryReader.ReadInt32(); this.team = (Team)binaryReader.ReadInt16(); this.parent = binaryReader.ReadShortBlockIndex1(); this.squadDelayTimeSeconds = binaryReader.ReadSingle(); this.normalDiffCountInitialNumberOfActorsOnNormalDifficulty = binaryReader.ReadInt16(); this.insaneDiffCountInitialNumberOfActorsOnInsaneDifficultyHardDifficultyIsMidwayBetweenNormalAndInsane = binaryReader.ReadInt16(); this.majorUpgrade = (MajorUpgrade)binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); this.vehicleType = binaryReader.ReadShortBlockIndex1(); this.characterType = binaryReader.ReadShortBlockIndex1(); this.initialZone = binaryReader.ReadShortBlockIndex1(); this.padding0 = binaryReader.ReadBytes(2); this.initialWeapon = binaryReader.ReadShortBlockIndex1(); this.initialSecondaryWeapon = binaryReader.ReadShortBlockIndex1(); this.grenadeType = (GrenadeType)binaryReader.ReadInt16(); this.initialOrder = binaryReader.ReadShortBlockIndex1(); this.vehicleVariant = binaryReader.ReadStringID(); { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(ActorStartingLocationsBlock)); this.startingLocations = new ActorStartingLocationsBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.startingLocations[i] = new ActorStartingLocationsBlock(binaryReader); } } } this.placementScript = binaryReader.ReadString32(); this.skip1 = binaryReader.ReadBytes(2); this.padding2 = binaryReader.ReadBytes(2); }