public static String32 Decode(XdrDataInputStream stream) { var decodedString32 = new String32(); decodedString32.InnerValue = stream.ReadString(); return(decodedString32); }
public static AccountEntry Decode(XdrDataInputStream stream) { var decodedAccountEntry = new AccountEntry(); decodedAccountEntry.AccountID = AccountID.Decode(stream); decodedAccountEntry.Balance = Int64.Decode(stream); decodedAccountEntry.SeqNum = SequenceNumber.Decode(stream); decodedAccountEntry.NumSubEntries = Uint32.Decode(stream); var InflationDestPresent = stream.ReadInt(); if (InflationDestPresent != 0) { decodedAccountEntry.InflationDest = AccountID.Decode(stream); } decodedAccountEntry.Flags = Uint32.Decode(stream); decodedAccountEntry.HomeDomain = String32.Decode(stream); decodedAccountEntry.Thresholds = Thresholds.Decode(stream); var signerssize = stream.ReadInt(); decodedAccountEntry.Signers = new Signer[signerssize]; for (var i = 0; i < signerssize; i++) { decodedAccountEntry.Signers[i] = Signer.Decode(stream); } decodedAccountEntry.Ext = AccountEntryExt.Decode(stream); return(decodedAccountEntry); }
public void Read(BinaryReader reader) { this.mapHeaderSignature = reader.ReadInt32(); this.engineVersion = reader.ReadInt32(); this.fileSize = reader.ReadInt32(); this.scenarioPointer = reader.ReadInt32(); this.indexOffset = reader.ReadInt32(); this.indexSize = reader.ReadInt32(); this.metaTableSize = reader.ReadInt32(); this.nonRawSize = reader.ReadInt32(); this.padding1 = reader.ReadBytes(PaddingAttribute.GetPaddingFieldSize(this.GetType(), "padding1")); this.buildDate = reader.ReadString32(); this.mapType = (MapType)reader.ReadInt32(); this.padding2 = reader.ReadBytes(PaddingAttribute.GetPaddingFieldSize(this.GetType(), "padding2")); this.crazyOffset = reader.ReadInt32(); this.crazySize = reader.ReadInt32(); this.stringIdPaddedTableOffset = reader.ReadInt32(); this.stringIdCount = reader.ReadInt32(); this.stringIdTableSize = reader.ReadInt32(); this.stringIdIndexOffset = reader.ReadInt32(); this.stringIdTableOffset = reader.ReadInt32(); this.padding3 = reader.ReadBytes(PaddingAttribute.GetPaddingFieldSize(this.GetType(), "padding3")); this.mapName = reader.ReadString32(); this.padding4 = reader.ReadInt32(); this.mapScenario = reader.ReadString256(); this.padding5 = reader.ReadInt32(); this.tagCount = reader.ReadInt32(); this.fileTableOffset = reader.ReadInt32(); this.fileTableSize = reader.ReadInt32(); this.fileTableIndexOffset = reader.ReadInt32(); this.checksum = reader.ReadInt32(); this.padding6 = reader.ReadBytes(PaddingAttribute.GetPaddingFieldSize(this.GetType(), "padding6")); this.mapFooterSignature = reader.ReadInt32(); }
public static void Encode(XdrDataOutputStream stream, AccountEntry encodedAccountEntry) { AccountID.Encode(stream, encodedAccountEntry.AccountID); Int64.Encode(stream, encodedAccountEntry.Balance); SequenceNumber.Encode(stream, encodedAccountEntry.SeqNum); Uint32.Encode(stream, encodedAccountEntry.NumSubEntries); if (encodedAccountEntry.InflationDest != null) { stream.WriteInt(1); AccountID.Encode(stream, encodedAccountEntry.InflationDest); } else { stream.WriteInt(0); } Uint32.Encode(stream, encodedAccountEntry.Flags); String32.Encode(stream, encodedAccountEntry.HomeDomain); Thresholds.Encode(stream, encodedAccountEntry.Thresholds); int signerssize = encodedAccountEntry.Signers.Length; stream.WriteInt(signerssize); for (int i = 0; i < signerssize; i++) { Signer.Encode(stream, encodedAccountEntry.Signers[i]); } AccountEntryExt.Encode(stream, encodedAccountEntry.Ext); }
public static String32 Decode(IByteReader stream) { String32 decodedString32 = new String32(); decodedString32.InnerValue = XdrEncoding.ReadString(stream); return(decodedString32); }
public static AccountEntry Decode(IByteReader stream) { AccountEntry decodedAccountEntry = new AccountEntry(); decodedAccountEntry.AccountID = AccountID.Decode(stream); decodedAccountEntry.Balance = Int64.Decode(stream); decodedAccountEntry.SeqNum = SequenceNumber.Decode(stream); decodedAccountEntry.NumSubEntries = Uint32.Decode(stream); int inflationDestPresent = XdrEncoding.DecodeInt32(stream); if (inflationDestPresent != 0) { decodedAccountEntry.InflationDest = AccountID.Decode(stream); } decodedAccountEntry.Flags = Uint32.Decode(stream); decodedAccountEntry.HomeDomain = String32.Decode(stream); decodedAccountEntry.Thresholds = Thresholds.Decode(stream); int signerssize = XdrEncoding.DecodeInt32(stream); decodedAccountEntry.Signers = new Signer[signerssize]; for (int i = 0; i < signerssize; i++) { decodedAccountEntry.Signers[i] = Signer.Decode(stream); } decodedAccountEntry.Ext = AccountEntryExt.Decode(stream); return(decodedAccountEntry); }
public static void Encode(IByteWriter stream, AccountEntry encodedAccountEntry) { AccountID.Encode(stream, encodedAccountEntry.AccountID); Int64.Encode(stream, encodedAccountEntry.Balance); SequenceNumber.Encode(stream, encodedAccountEntry.SeqNum); Uint32.Encode(stream, encodedAccountEntry.NumSubEntries); if (encodedAccountEntry.InflationDest != null) { XdrEncoding.EncodeInt32(1, stream); AccountID.Encode(stream, encodedAccountEntry.InflationDest); } else { XdrEncoding.EncodeInt32(0, stream); } Uint32.Encode(stream, encodedAccountEntry.Flags); String32.Encode(stream, encodedAccountEntry.HomeDomain); Thresholds.Encode(stream, encodedAccountEntry.Thresholds); int signerssize = encodedAccountEntry.Signers.Length; XdrEncoding.EncodeInt32(signerssize, stream); for (int i = 0; i < signerssize; i++) { Signer.Encode(stream, encodedAccountEntry.Signers[i]); } AccountEntryExt.Encode(stream, encodedAccountEntry.Ext); }
public static SetOptionsOp Decode(IByteReader stream) { SetOptionsOp decodedSetOptionsOp = new SetOptionsOp(); int inflationDestPresent = XdrEncoding.DecodeInt32(stream); if (inflationDestPresent != 0) { decodedSetOptionsOp.InflationDest = AccountID.Decode(stream); } int clearFlagsPresent = XdrEncoding.DecodeInt32(stream); if (clearFlagsPresent != 0) { decodedSetOptionsOp.ClearFlags = Uint32.Decode(stream); } int setFlagsPresent = XdrEncoding.DecodeInt32(stream); if (setFlagsPresent != 0) { decodedSetOptionsOp.SetFlags = Uint32.Decode(stream); } int masterWeightPresent = XdrEncoding.DecodeInt32(stream); if (masterWeightPresent != 0) { decodedSetOptionsOp.MasterWeight = Uint32.Decode(stream); } int lowThresholdPresent = XdrEncoding.DecodeInt32(stream); if (lowThresholdPresent != 0) { decodedSetOptionsOp.LowThreshold = Uint32.Decode(stream); } int medThresholdPresent = XdrEncoding.DecodeInt32(stream); if (medThresholdPresent != 0) { decodedSetOptionsOp.MedThreshold = Uint32.Decode(stream); } int highThresholdPresent = XdrEncoding.DecodeInt32(stream); if (highThresholdPresent != 0) { decodedSetOptionsOp.HighThreshold = Uint32.Decode(stream); } int homeDomainPresent = XdrEncoding.DecodeInt32(stream); if (homeDomainPresent != 0) { decodedSetOptionsOp.HomeDomain = String32.Decode(stream); } int signerPresent = XdrEncoding.DecodeInt32(stream); if (signerPresent != 0) { decodedSetOptionsOp.Signer = Signer.Decode(stream); } return(decodedSetOptionsOp); }
public static SetOptionsOp Decode(XdrDataInputStream stream) { var decodedSetOptionsOp = new SetOptionsOp(); var InflationDestPresent = stream.ReadInt(); if (InflationDestPresent != 0) { decodedSetOptionsOp.InflationDest = AccountID.Decode(stream); } var ClearFlagsPresent = stream.ReadInt(); if (ClearFlagsPresent != 0) { decodedSetOptionsOp.ClearFlags = Uint32.Decode(stream); } var SetFlagsPresent = stream.ReadInt(); if (SetFlagsPresent != 0) { decodedSetOptionsOp.SetFlags = Uint32.Decode(stream); } var MasterWeightPresent = stream.ReadInt(); if (MasterWeightPresent != 0) { decodedSetOptionsOp.MasterWeight = Uint32.Decode(stream); } var LowThresholdPresent = stream.ReadInt(); if (LowThresholdPresent != 0) { decodedSetOptionsOp.LowThreshold = Uint32.Decode(stream); } var MedThresholdPresent = stream.ReadInt(); if (MedThresholdPresent != 0) { decodedSetOptionsOp.MedThreshold = Uint32.Decode(stream); } var HighThresholdPresent = stream.ReadInt(); if (HighThresholdPresent != 0) { decodedSetOptionsOp.HighThreshold = Uint32.Decode(stream); } var HomeDomainPresent = stream.ReadInt(); if (HomeDomainPresent != 0) { decodedSetOptionsOp.HomeDomain = String32.Decode(stream); } var SignerPresent = stream.ReadInt(); if (SignerPresent != 0) { decodedSetOptionsOp.Signer = Signer.Decode(stream); } return(decodedSetOptionsOp); }
public static String32 ReadString32(this BinaryReader reader) { // Read a String32 object from the stream. String32 @string = new String32(); @string.value = reader.ReadChars(String32.kSizeOf); return(@string); }
public void TestString() { byte[] bytes = { 0, 0, 0, 2, (byte)'a', (byte)'b', 1, 0 }; try { String32.Decode(new XdrDataInputStream(bytes)); } catch (IOException expectedException) { Assert.AreEqual("non-zero padding", expectedException.Message); throw; } }
public static void Encode(XdrDataOutputStream stream, SetOptionsOp encodedSetOptionsOp) { if (encodedSetOptionsOp.InflationDest != null) { stream.WriteInt(1); AccountID.Encode(stream, encodedSetOptionsOp.InflationDest); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.ClearFlags != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.ClearFlags); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.SetFlags != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.SetFlags); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.MasterWeight != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.MasterWeight); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.LowThreshold != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.LowThreshold); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.MedThreshold != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.MedThreshold); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.HighThreshold != null) { stream.WriteInt(1); Uint32.Encode(stream, encodedSetOptionsOp.HighThreshold); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.HomeDomain != null) { stream.WriteInt(1); String32.Encode(stream, encodedSetOptionsOp.HomeDomain); } else { stream.WriteInt(0); } if (encodedSetOptionsOp.Signer != null) { stream.WriteInt(1); Signer.Encode(stream, encodedSetOptionsOp.Signer); } else { stream.WriteInt(0); } }
public StructureBspWeatherPaletteBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.weatherSystem = binaryReader.ReadTagReference(); this.padding = binaryReader.ReadBytes(2); this.padding0 = binaryReader.ReadBytes(2); this.padding1 = binaryReader.ReadBytes(32); this.wind = binaryReader.ReadTagReference(); this.windDirection = binaryReader.ReadVector3(); this.windMagnitude = binaryReader.ReadSingle(); this.padding2 = binaryReader.ReadBytes(4); this.windScaleFunction = binaryReader.ReadString32(); }
public StructureBspBackgroundSoundPaletteBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.backgroundSound = binaryReader.ReadTagReference(); this.insideClusterSoundPlayOnlyWhenPlayerIsInsideCluster = binaryReader.ReadTagReference(); this.padding = binaryReader.ReadBytes(20); this.cutoffDistance = binaryReader.ReadSingle(); this.scaleFlags = (ScaleFlags)binaryReader.ReadInt32(); this.interiorScale = binaryReader.ReadSingle(); this.portalScale = binaryReader.ReadSingle(); this.exteriorScale = binaryReader.ReadSingle(); this.interpolationSpeed1Sec = binaryReader.ReadSingle(); this.padding0 = binaryReader.ReadBytes(8); }
public OrderCompletionCondition(BinaryReader binaryReader) { this.ruleType = (RuleType)binaryReader.ReadInt16(); this.squad = binaryReader.ReadShortBlockIndex1(); this.squadGroup = binaryReader.ReadShortBlockIndex1(); this.a = binaryReader.ReadInt16(); this.x = binaryReader.ReadSingle(); this.triggerVolume = binaryReader.ReadShortBlockIndex1(); this.padding = binaryReader.ReadBytes(2); this.exitConditionScript = binaryReader.ReadString32(); this.invalidName_0 = binaryReader.ReadInt16(); this.padding1 = binaryReader.ReadBytes(2); this.flags = (Flags)binaryReader.ReadInt32(); }
public ScenarioCutsceneCameraPointBlock(BinaryReader binaryReader) { this.flags = (Flags)binaryReader.ReadInt16(); this.type = (Type)binaryReader.ReadInt16(); this.name = binaryReader.ReadString32(); this.position = binaryReader.ReadVector3(); this.orientation = binaryReader.ReadVector3(); this.unused = binaryReader.ReadSingle(); }
public CsPointSetBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(CsPointBlock)); this.points = new CsPointBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.points[i] = new CsPointBlock(binaryReader); } } } this.bspIndex = binaryReader.ReadShortBlockIndex1(); this.manualReferenceFrame = binaryReader.ReadInt16(); this.flags = (Flags)binaryReader.ReadInt32(); }
public HsSourceFilesBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.paddingsource = binaryReader.ReadBytes(8); }
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); }
public ActorStartingLocationsBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadStringID(); this.position = binaryReader.ReadVector3(); this.referenceFrame = binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); this.facingYawPitchDegrees = binaryReader.ReadVector2(); this.flags = (Flags)binaryReader.ReadInt32(); this.characterType = binaryReader.ReadShortBlockIndex1(); this.initialWeapon = binaryReader.ReadShortBlockIndex1(); this.initialSecondaryWeapon = binaryReader.ReadShortBlockIndex1(); this.padding0 = binaryReader.ReadBytes(2); this.vehicleType = binaryReader.ReadShortBlockIndex1(); this.seatType = (SeatType)binaryReader.ReadInt16(); this.grenadeType = (GrenadeType)binaryReader.ReadInt16(); this.swarmCountNumberOfCreturesInSwarmIfASwarmIsSpawnedAtThisLocation = binaryReader.ReadInt16(); this.actorVariantName = binaryReader.ReadStringID(); this.vehicleVariantName = binaryReader.ReadStringID(); this.initialMovementDistanceBeforeDoingAnythingElseTheActorWillTravelTheGivenDistanceInItsForwardDirection = binaryReader.ReadSingle(); this.emitterVehicle = binaryReader.ReadShortBlockIndex1(); this.initialMovementMode = (InitialMovementMode)binaryReader.ReadInt16(); this.placementScript = binaryReader.ReadString32(); this.skip1 = binaryReader.ReadBytes(2); this.padding2 = binaryReader.ReadBytes(2); }
public SquadGroupsBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.parent = binaryReader.ReadShortBlockIndex1(); this.initialOrders = binaryReader.ReadShortBlockIndex1(); }
public RecordedAnimationBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.version = binaryReader.ReadByte(); this.rawAnimationData = binaryReader.ReadByte(); this.unitControlDataVersion = binaryReader.ReadByte(); this.padding = binaryReader.ReadByte(); this.lengthOfAnimationTicks = binaryReader.ReadInt16(); this.padding0 = binaryReader.ReadBytes(2); this.padding1 = binaryReader.ReadBytes(4); this.paddingrecordedAnimationEventStream = binaryReader.ReadBytes(8); }
public ScenarioProfilesBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.startingHealthDamage01 = binaryReader.ReadSingle(); this.startingShieldDamage01 = binaryReader.ReadSingle(); this.primaryWeapon = binaryReader.ReadTagReference(); this.roundsLoaded = binaryReader.ReadInt16(); this.roundsTotal = binaryReader.ReadInt16(); this.secondaryWeapon = binaryReader.ReadTagReference(); this.roundsLoaded0 = binaryReader.ReadInt16(); this.roundsTotal0 = binaryReader.ReadInt16(); this.startingFragmentationGrenadeCount = binaryReader.ReadByte(); this.startingPlasmaGrenadeCount = binaryReader.ReadByte(); this.startingUnknownGrenadeCount = binaryReader.ReadByte(); this.startingUnknownGrenadeCount0 = binaryReader.ReadByte(); }
public DeviceGroupBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.initialValue01 = binaryReader.ReadSingle(); this.flags = (Flags)binaryReader.ReadInt32(); }
public ScenarioObjectNamesBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.eMPTYSTRING = binaryReader.ReadShortBlockIndex1(); this.eMPTYSTRING0 = binaryReader.ReadShortBlockIndex2(); }
public GlobalTagImportInfoBlock(BinaryReader binaryReader) { this.build = binaryReader.ReadInt32(); this.version = binaryReader.ReadString256(); this.importDate = binaryReader.ReadString32(); this.culprit = binaryReader.ReadString32(); this.padding = binaryReader.ReadBytes(96); this.importTime = binaryReader.ReadString32(); this.padding0 = binaryReader.ReadBytes(4); this.files = ReadFiles(binaryReader); this.padding1 = binaryReader.ReadBytes(128); }
public EditorCommentBlock(BinaryReader binaryReader) { this.position = binaryReader.ReadVector3(); this.type = (Type)binaryReader.ReadInt32(); this.name = binaryReader.ReadString32(); this.comment = binaryReader.ReadString256(); }
public AreasBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.areaFlags = (AreaFlags)binaryReader.ReadInt32(); this.skip = binaryReader.ReadBytes(20); this.skip0 = binaryReader.ReadBytes(4); this.padding1 = binaryReader.ReadBytes(64); this.manualReferenceFrame = binaryReader.ReadInt16(); this.padding2 = binaryReader.ReadBytes(2); { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(FlightReferenceBlock)); this.flightHints = new FlightReferenceBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.flightHints[i] = new FlightReferenceBlock(binaryReader); } } } }
public CsPointBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.position = binaryReader.ReadVector3(); this.referenceFrame = binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); this.surfaceIndex = binaryReader.ReadInt32(); this.facingDirection = binaryReader.ReadVector2(); }
public ZoneBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.flags = (Flags)binaryReader.ReadInt32(); this.manualBsp = binaryReader.ReadShortBlockIndex1(); this.padding = binaryReader.ReadBytes(2); { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(FiringPositionsBlock)); this.firingPositions = new FiringPositionsBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.firingPositions[i] = new FiringPositionsBlock(binaryReader); } } } { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(AreasBlock)); this.areas = new AreasBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.areas[i] = new AreasBlock(binaryReader); } } } }
public ScenarioCutsceneFlagBlock(BinaryReader binaryReader) { this.padding = binaryReader.ReadBytes(4); this.name = binaryReader.ReadString32(); this.position = binaryReader.ReadVector3(); this.facing = binaryReader.ReadVector2(); }
public AiAnimationReferenceBlock(BinaryReader binaryReader) { this.animationName = binaryReader.ReadString32(); this.animationGraphLeaveThisBlankToUseTheUnitsNormalAnimationGraph = binaryReader.ReadTagReference(); this.padding = binaryReader.ReadBytes(12); }
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); } } } }
public static void Encode(IByteWriter stream, SetOptionsOp encodedSetOptionsOp) { if (encodedSetOptionsOp.InflationDest != null) { XdrEncoding.EncodeInt32(1, stream); AccountID.Encode(stream, encodedSetOptionsOp.InflationDest); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.ClearFlags != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.ClearFlags); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.SetFlags != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.SetFlags); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.MasterWeight != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.MasterWeight); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.LowThreshold != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.LowThreshold); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.MedThreshold != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.MedThreshold); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.HighThreshold != null) { XdrEncoding.EncodeInt32(1, stream); Uint32.Encode(stream, encodedSetOptionsOp.HighThreshold); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.HomeDomain != null) { XdrEncoding.EncodeInt32(1, stream); String32.Encode(stream, encodedSetOptionsOp.HomeDomain); } else { XdrEncoding.EncodeInt32(0, stream); } if (encodedSetOptionsOp.Signer != null) { XdrEncoding.EncodeInt32(1, stream); Signer.Encode(stream, encodedSetOptionsOp.Signer); } else { XdrEncoding.EncodeInt32(0, stream); } }
public TriggersBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.triggerFlags = (TriggerFlags)binaryReader.ReadInt32(); this.combinationRule = (CombinationRule)binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(OrderCompletionCondition)); this.conditions = new OrderCompletionCondition[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.conditions[i] = new OrderCompletionCondition(binaryReader); } } } }
public static void Encode(IByteWriter stream, String32 encodedString32) { XdrEncoding.WriteString(stream, encodedString32.InnerValue); }
public StructureBspSoundEnvironmentPaletteBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.soundEnvironment = binaryReader.ReadTagReference(); this.cutoffDistance = binaryReader.ReadSingle(); this.interpolationSpeed1Sec = binaryReader.ReadSingle(); this.padding = binaryReader.ReadBytes(24); }
public AiConversationParticipantBlock(BinaryReader binaryReader) { this.padding = binaryReader.ReadBytes(8); this.useThisObjectIfAUnitWithThisNameExistsWeTryToPickThemToStartTheConversation = binaryReader.ReadShortBlockIndex1(); this.setNewNameOnceWePickAUnitWeNameItThis = binaryReader.ReadShortBlockIndex1(); this.padding0 = binaryReader.ReadBytes(12); this.padding1 = binaryReader.ReadBytes(12); this.encounterName = binaryReader.ReadString32(); this.padding2 = binaryReader.ReadBytes(4); this.padding3 = binaryReader.ReadBytes(12); }
public static void Encode(XdrDataOutputStream stream, String32 encodedString32) { stream.WriteString(encodedString32.InnerValue); }
public AiConversationBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.flags = (Flags)binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); this.triggerDistanceWorldUnitsDistanceThePlayerMustEnterBeforeTheConversationCanTrigger = binaryReader.ReadSingle(); this.runToPlayerDistWorldUnitsIfTheInvolvesPlayerFlagIsSetWhenTriggeredTheConversationsParticipantSWillRunToWithinThisDistanceOfThePlayer = binaryReader.ReadSingle(); this.padding0 = binaryReader.ReadBytes(36); { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(AiConversationParticipantBlock)); this.participants = new AiConversationParticipantBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.participants[i] = new AiConversationParticipantBlock(binaryReader); } } } { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(AiConversationLineBlock)); this.lines = new AiConversationLineBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.lines[i] = new AiConversationLineBlock(binaryReader); } } } { var count = binaryReader.ReadInt32(); var address = binaryReader.ReadInt32(); var elementSize = Marshal.SizeOf(typeof(GNullBlock)); this.gNullBlock = new GNullBlock[count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < count; ++i) { binaryReader.BaseStream.Position = address + i * elementSize; this.gNullBlock[i] = new GNullBlock(binaryReader); } } } }
public HsScriptsBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.scriptType = (ScriptType)binaryReader.ReadInt16(); this.returnType = (ReturnType)binaryReader.ReadInt16(); this.rootExpressionIndex = binaryReader.ReadInt32(); }
public HsGlobalsBlock(BinaryReader binaryReader) { this.name = binaryReader.ReadString32(); this.type = (Type)binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); this.initializationExpressionIndex = binaryReader.ReadInt32(); }
public AiScriptReferenceBlock(BinaryReader binaryReader) { this.scriptName = binaryReader.ReadString32(); this.padding = binaryReader.ReadBytes(8); }
public ScenarioFunctionBlock(BinaryReader binaryReader) { this.flags = (Flags)binaryReader.ReadInt32(); this.name = binaryReader.ReadString32(); this.periodSecondsPeriodForAboveFunctionLowerValuesMakeFunctionOscillateQuicklyHigherValuesMakeItOscillateSlowly = binaryReader.ReadSingle(); this.scalePeriodByMultiplyThisFunctionByAbovePeriod = binaryReader.ReadShortBlockIndex1(); this.function = (Function)binaryReader.ReadInt16(); this.scaleFunctionByMultiplyThisFunctionByResultOfAboveFunction = binaryReader.ReadShortBlockIndex1(); this.wobbleFunctionCurveUsedForWobble = (WobbleFunctionCurveUsedForWobble)binaryReader.ReadInt16(); this.wobblePeriodSecondsTimeItTakesForMagnitudeOfThisFunctionToCompleteAWobble = binaryReader.ReadSingle(); this.wobbleMagnitudePercentAmountOfRandomWobbleInTheMagnitude = binaryReader.ReadSingle(); this.squareWaveThresholdIfNonZeroAllValuesAboveSquareWaveThresholdAreSnappedTo10AndAllValuesBelowItAreSnappedTo00ToCreateASquareWave = binaryReader.ReadSingle(); this.stepCountNumberOfDiscreteValuesToSnapToEGStepCountOf5SnapsFunctionTo000025050075Or100 = binaryReader.ReadInt16(); this.mapTo = (MapTo)binaryReader.ReadInt16(); this.sawtoothCountNumberOfTimesThisFunctionShouldRepeatEGSawtoothCountOf5GivesFunctionValueOf10AtEachOf025050And075AsWellAsAt10 = binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); this.scaleResultByMultiplyThisFunctionEGFromAWeaponVehicleFinalResultOfAllOfTheAboveMath = binaryReader.ReadShortBlockIndex1(); this.boundsModeControlsHowBoundsBelowAreUsed = (BoundsModeControlsHowBoundsBelowAreUsed)binaryReader.ReadInt16(); this.bounds = binaryReader.ReadSingle(); this.padding0 = binaryReader.ReadBytes(4); this.padding1 = binaryReader.ReadBytes(2); this.turnOffWithIfSpecifiedFunctionIsOffSoIsThisFunction = binaryReader.ReadShortBlockIndex1(); this.padding2 = binaryReader.ReadBytes(16); this.padding3 = binaryReader.ReadBytes(16); }
public static void Write(this BinaryWriter writer, String32 @string) { // Write a String32 object to the stream. writer.Write(@string.value); }
public AiRecordingReferenceBlock(BinaryReader binaryReader) { this.recordingName = binaryReader.ReadString32(); this.padding = binaryReader.ReadBytes(8); }