/// <summary> /// Writes the data element into the given buffer (at its current position). /// </summary> /// <param name="buffer">The buffer where the data element should be deserialized into.</param> public void WriteData(RAMBuffer buffer) { buffer.WriteUShort((ushort)PlayerName.Length); buffer.WriteString(PlayerName); buffer.WriteFloat(InitialCameraX); buffer.WriteFloat(InitialCameraY); buffer.WriteShort(UnknownX); buffer.WriteShort(UnknownY); buffer.WriteByte(AlliedVictory); ScenarioDataElementTools.AssertTrue(Diplomacy1.Count == Diplomacy2.Count); buffer.WriteUShort((ushort)Diplomacy1.Count); Diplomacy1.ForEach(d => buffer.WriteByte((byte)d)); Diplomacy2.ForEach(d => buffer.WriteUInteger((uint)d)); buffer.WriteUInteger(Color); buffer.WriteFloat(Unknown1); buffer.WriteUShort(Unknown3Count); if (Unknown1 == 2) { ScenarioDataElementTools.AssertListLength(Unknown2, 8); Unknown2.ForEach(b => buffer.WriteByte(b)); } ScenarioDataElementTools.AssertListLength(Unknown3, Unknown3Count * 44); Unknown3.ForEach(b => buffer.WriteByte(b)); ScenarioDataElementTools.AssertListLength(Unknown4, 7); Unknown4.ForEach(b => buffer.WriteByte(b)); buffer.WriteInteger(Unknown5); }
public void WriteData(RAMBuffer buffer) { buffer.WriteByte(Type); buffer.WriteShort(A); buffer.WriteShort(B); buffer.WriteShort(C); buffer.WriteFloat(D); }
public void WriteData(RAMBuffer buffer) { buffer.WriteString(FileName, 13); buffer.WriteInteger(ResourceID); buffer.WriteShort(Probability); buffer.WriteShort(Civ); buffer.WriteShort(Unknown1); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(ID); buffer.WriteShort(Unknown1); buffer.WriteShort((short)Items.Count); buffer.WriteInteger(Unknown2); Items.ForEach(e => e.WriteData(buffer)); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(SheepConversion); buffer.WriteFloat(SearchRadius); buffer.WriteFloat(WorkRate); buffer.WriteShort(DropSite1); buffer.WriteShort(DropSite2); buffer.WriteByte(VillagerMode); buffer.WriteShort(AttackSound); buffer.WriteShort(MoveSound); buffer.WriteByte(AnimalMode); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(WalkingGraphic1); buffer.WriteShort(WalkingGraphic2); buffer.WriteFloat(RotationSpeed); buffer.WriteByte(Unknown11); buffer.WriteShort(TrackingUnit); buffer.WriteByte(TrackingUnitUsed); buffer.WriteFloat(TrackingUnitDensity); buffer.WriteByte(Unknown16); AssertListLength(Unknown16B, 5); Unknown16B.ForEach(e => buffer.WriteInteger(e)); }
private void _saveSimulationButton_Click(object sender, RoutedEventArgs e) { // Show dialog SaveFileDialog dialog = new SaveFileDialog { Filter = "Simulation files (*.balancingsim)|*.balancingsim", Title = "Save simulation..." }; if (!(dialog.ShowDialog() ?? false)) { return; } // Create buffer RAMBuffer buffer = new RAMBuffer(); // Write version buffer.WriteInteger(Version); // Write civ IDs buffer.WriteShort((short)(_civ1ComboBox.SelectedValue ?? (short)-1)); buffer.WriteShort((short)(_civ2ComboBox.SelectedValue ?? (short)-1)); // Run through techs and write IDs of checked ones var res1 = Researches1.Where(r => r.Checked).Select(r => r.Id).ToList(); buffer.WriteInteger(res1.Count); res1.ForEach(buffer.WriteShort); var res2 = Researches2.Where(r => r.Checked).Select(r => r.Id).ToList(); buffer.WriteInteger(res2.Count); res2.ForEach(buffer.WriteShort); // Write duels buffer.WriteInteger(Duels.Count); foreach (var duel in Duels) { buffer.WriteShort(duel.Id1); buffer.WriteShort(duel.Id2); } // Save try { buffer.Save(dialog.FileName); } catch (IOException ex) { // Error MessageBox.Show($"Unable to save simulation data: {ex.Message}"); } }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(GraphicID); buffer.WriteByte(DamagePercent); buffer.WriteByte(ApplyMode); buffer.WriteByte(Unknown2); }
public void WriteData(RAMBuffer buffer) { buffer.WriteInteger(LandID); buffer.WriteInteger(Terrain); buffer.WriteInteger(LandSpacing); buffer.WriteInteger(BaseSize); buffer.WriteByte(Zone); buffer.WriteByte(PlacementType); buffer.WriteShort(Padding1); buffer.WriteInteger(BaseX); buffer.WriteInteger(BaseY); buffer.WriteByte(LandProportion); buffer.WriteByte(ByPlayerFlag); buffer.WriteShort(Padding2); buffer.WriteInteger(StartAreaRadius); buffer.WriteInteger(TerrainEdgeFade); buffer.WriteInteger(Clumpiness); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(GraphicID); buffer.WriteShort(Unknown1); buffer.WriteShort(Unknown2); buffer.WriteShort(Unknown3); buffer.WriteShort(DirectionX); buffer.WriteShort(DirectionY); buffer.WriteShort(Unknown4); buffer.WriteShort(Unknown5); }
/// <summary> /// Writes the data element into the given buffer (at its current position). /// </summary> /// <param name="buffer">The buffer where the data element should be deserialized into.</param> public void WriteData(RAMBuffer buffer) { ScenarioDataElementTools.AssertListLength(UnknownStrings, 32); UnknownStrings.ForEach(s => { buffer.WriteShort((short)s.Length); buffer.WriteString(s); }); ScenarioDataElementTools.AssertListLength(AiNames, 16); AiNames.ForEach(s => { buffer.WriteShort((short)s.Length); buffer.WriteString(s); }); ScenarioDataElementTools.AssertListLength(AiFiles, 16); AiFiles.ForEach(f => f.WriteData(buffer)); ScenarioDataElementTools.AssertListLength(AiTypes, 16); AiTypes.ForEach(t => buffer.WriteByte(t)); buffer.WriteUInteger(0xFFFFFF9D); ScenarioDataElementTools.AssertListLength(ResourceEntries, 16); ResourceEntries.ForEach(e => e.WriteData(buffer)); }
public void WriteData(RAMBuffer buffer) { buffer.WriteByte(One); buffer.WriteString(Name, 20); buffer.WriteUShort((ushort)Resources.Count); buffer.WriteShort(TechTreeID); buffer.WriteShort(TeamBonusID); Resources.ForEach(e => buffer.WriteFloat(e)); buffer.WriteByte(IconSet); buffer.WriteUShort((ushort)UnitPointers.Count); UnitPointers.ForEach(e => buffer.WriteInteger(e)); // Sicherstellen, dass genau jede definierte Einheit einen entsprechenden Pointer hat; hier nur über die Listenlänge, sollte aber die meisten auftretenden Fehler abdecken AssertListLength(Units, UnitPointers.Count(p => p != 0)); foreach (var u in Units) { u.Value.WriteData(buffer); } }
public void WriteData(RAMBuffer buffer) { AssertListLength(ResourceCosts, 3); ResourceCosts.ForEach(e => { buffer.WriteShort(e.Type); buffer.WriteShort(e.Amount); buffer.WriteShort(e.Mode); }); buffer.WriteShort(TrainTime); buffer.WriteShort(TrainLocationID); buffer.WriteByte(ButtonID); buffer.WriteFloat(Unknown26); buffer.WriteFloat(Unknown27); buffer.WriteByte(Unknown28); buffer.WriteByte(HeroMode); buffer.WriteInteger(GarrisonGraphic); buffer.WriteFloat(ProjectileCount); buffer.WriteByte(ProjectileCountOnFullGarrison); buffer.WriteFloat(ProjectileSpawningAreaWidth); buffer.WriteFloat(ProjectileSpawningAreaHeight); buffer.WriteFloat(ProjectileSpawningAreaRandomness); buffer.WriteInteger(AlternativeProjectileUnit); buffer.WriteInteger(ChargingGraphic); buffer.WriteByte(ChargingMode); buffer.WriteShort(DisplayedPierceArmor); }
public void WriteData(RAMBuffer buffer) { // Eigenschaften schreiben buffer.WriteByte((byte)ElementType); buffer.WriteShort(ElementObjectID); buffer.WriteByte(Age); buffer.WriteByte((byte)RenderMode); // Deaktivierende Kulturen schreiben buffer.WriteByte((byte)DisableCivs.Count); DisableCivs.ForEach(c => buffer.WriteByte(c)); // Kindelemente schreiben buffer.WriteShort((short)Children.Count); Children.ForEach(c => c.WriteData(buffer)); // Benötigte Elemente schreiben buffer.WriteShort((short)RequiredElements.Count); RequiredElements.ForEach(r => { buffer.WriteByte((byte)r.Item1); buffer.WriteShort(r.Item2); }); // Node-Hintergrund schreiben buffer.WriteInteger(NodeTypeIndex); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(SoundDelay1); buffer.WriteShort(SoundID1); buffer.WriteShort(SoundDelay2); buffer.WriteShort(SoundID2); buffer.WriteShort(SoundDelay3); buffer.WriteShort(SoundID3); }
/// <summary> /// Schreibt die TechTree-Daten. /// </summary> /// <param name="buffer">Der Datenpuffer.</param> /// <param name="writeTreeOnly">Gibt an, ob nur die Baumdaten (und nicht auch das Design) geschrieben werden sollen.</param> public void WriteData(RAMBuffer buffer, bool writeTreeOnly) { // Version schreiben buffer.WriteByte(NEW_TECH_TREE_VERSION); // Stammelemente schreiben buffer.WriteShort((short)ParentElements.Count); ParentElements.ForEach(p => p.WriteData(buffer)); // Designdaten schreiben if (!writeTreeOnly) { DesignData.WriteData(buffer); } }
public void WriteData(RAMBuffer buffer) { buffer.WriteString(Name1, 21); buffer.WriteString(Name2, 13); buffer.WriteInteger(SLP); buffer.WriteByte(Unknown1); buffer.WriteByte(Unknown2); buffer.WriteByte(Layer); buffer.WriteByte(PlayerColor); buffer.WriteByte(Rainbow); buffer.WriteByte(Replay); AssertListLength(Coordinates, 4); Coordinates.ForEach(e => buffer.WriteShort(e)); buffer.WriteUShort((ushort)Deltas.Count); buffer.WriteShort(SoundID); buffer.WriteByte(AttackSoundUsed); buffer.WriteUShort(FrameCount); buffer.WriteUShort(AngleCount); buffer.WriteFloat(NewSpeed); buffer.WriteFloat(FrameRate); buffer.WriteFloat(ReplayDelay); buffer.WriteByte(SequenceType); buffer.WriteShort(ID); buffer.WriteByte(MirroringMode); buffer.WriteByte(Unknown3); Deltas.ForEach(e => e.WriteData(buffer)); if (AttackSoundUsed != 0) { AssertListLength(AttackSounds, AngleCount); AttackSounds.ForEach(e => e.WriteData(buffer)); } }
public void WriteData(RAMBuffer buffer) { buffer.WriteInteger(Unit); buffer.WriteInteger(HostTerrain); buffer.WriteByte(GroupPlacing); buffer.WriteByte(ScaleFlag); buffer.WriteShort(Padding1); buffer.WriteInteger(ObjectsPerGroup); buffer.WriteInteger(Fluctuation); buffer.WriteInteger(GroupsPerPlayer); buffer.WriteInteger(GroupArea); buffer.WriteInteger(PlayerID); buffer.WriteInteger(SetPlaceForAllPlayers); buffer.WriteInteger(MinDistanceToPlayers); buffer.WriteInteger(MaxDistanceToPlayers); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(DefaultArmor); buffer.WriteUShort((ushort)Attacks.Count); foreach (KeyValuePair <ushort, ushort> currA in Attacks) { buffer.WriteUShort(currA.Key); buffer.WriteUShort(currA.Value); } buffer.WriteUShort((ushort)Armors.Count); foreach (KeyValuePair <ushort, ushort> currA in Armors) { buffer.WriteUShort(currA.Key); buffer.WriteUShort(currA.Value); } buffer.WriteShort(TerrainRestrictionForDamageMultiplying); buffer.WriteFloat(MaxRange); buffer.WriteFloat(BlastRadius); buffer.WriteFloat(ReloadTime); buffer.WriteShort(ProjectileUnitID); buffer.WriteShort(ProjectileAccuracyPercent); buffer.WriteByte(TowerMode); buffer.WriteShort(ProjectileFrameDelay); AssertListLength(ProjectileGraphicDisplacement, 3); ProjectileGraphicDisplacement.ForEach(e => buffer.WriteFloat(e)); buffer.WriteByte(BlastLevel); buffer.WriteFloat(MinRange); buffer.WriteFloat(ProjectileDispersion); buffer.WriteShort(AttackGraphic); buffer.WriteShort(DisplayedMeleeArmor); buffer.WriteShort(DisplayedAttack); buffer.WriteFloat(DisplayedRange); buffer.WriteFloat(DisplayedReloadTime); }
/// <summary> /// Writes the data element into the given buffer (at its current position). /// </summary> /// <param name="buffer">The buffer where the data element should be deserialized into.</param> public void WriteData(RAMBuffer buffer) { buffer.WriteUInteger(NextUnitIdToPlace); buffer.WriteFloat(1.22f); ScenarioDataElementTools.AssertListLength(PlayerNames, 16); PlayerNames.ForEach(p => buffer.WriteString(p, 256)); ScenarioDataElementTools.AssertListLength(PlayerNameDllIds, 16); PlayerNameDllIds.ForEach(p => buffer.WriteUInteger(p)); ScenarioDataElementTools.AssertListLength(PlayerData, 16); PlayerData.ForEach(p => p.WriteData(buffer)); buffer.WriteUInteger(Unknown1); buffer.WriteByte(0); buffer.WriteFloat(Unknown2); buffer.WriteShort((short)OriginalFileName.Length); buffer.WriteString(OriginalFileName); }
public void WriteData(RAMBuffer buffer) { buffer.WriteByte(Enabled); buffer.WriteByte(Random); buffer.WriteString(Name, 13); buffer.WriteString(Name2, 13); buffer.WriteInteger(SLP); buffer.WriteInteger(ShapePtr); buffer.WriteInteger(SoundID); AssertListLength(Colors, 3); Colors.ForEach(col => buffer.WriteByte(col)); buffer.WriteByte(IsAnimated); buffer.WriteShort(AnimationFrames); buffer.WriteShort(PauseFames); buffer.WriteFloat(Interval); buffer.WriteFloat(PauseBetweenLoops); buffer.WriteShort(Frame); buffer.WriteShort(DrawFrame); buffer.WriteFloat(AnimateLast); buffer.WriteByte(FrameChanged); buffer.WriteByte(Drawn); AssertListLength(Borders, 19); Borders.ForEach(b => { AssertListLength(b, 12); b.ForEach(fd => fd.WriteData(buffer)); }); buffer.WriteShort(DrawTerrain); buffer.WriteShort(UnderlayTerrain); buffer.WriteShort(BorderStyle); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(FrameCount); buffer.WriteShort(AngleCount); buffer.WriteShort(ShapeID); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(UnitID); buffer.WriteFloat(MisplacementX); buffer.WriteFloat(MisplacementY); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(Width); buffer.WriteShort(Height); buffer.WriteShort(DeltaY); }
public void WriteData(RAMBuffer buffer) { AssertListLength(RequiredTechs, 6); RequiredTechs.ForEach(e => buffer.WriteShort(e)); AssertListLength(ResourceCosts, 3); ResourceCosts.ForEach(e => { buffer.WriteShort(e.Type); buffer.WriteShort(e.Amount); buffer.WriteByte(e.Mode); }); buffer.WriteShort(RequiredTechCount); buffer.WriteShort(Civ); buffer.WriteShort(FullTechMode); buffer.WriteShort(ResearchLocation); buffer.WriteUShort(LanguageDLLName1); buffer.WriteUShort(LanguageDLLDescription); buffer.WriteShort(ResearchTime); buffer.WriteShort(TechageID); buffer.WriteShort(Type); buffer.WriteShort(IconID); buffer.WriteByte(ButtonID); buffer.WriteInteger(LanguageDLLHelp); buffer.WriteInteger(LanguageDLLName2); buffer.WriteInteger(Unknown1); buffer.WriteUShort((ushort)Name.Length); buffer.WriteString(Name); }
/// <summary> /// Writes the data element into the given buffer (at its current position). /// </summary> /// <param name="buffer">The buffer where the data element should be deserialized into.</param> public void WriteData(RAMBuffer buffer) { buffer.WriteUInteger(InstructionsStringDllId); buffer.WriteUInteger(HintsStringDllId); buffer.WriteUInteger(VictoryStringDllId); buffer.WriteUInteger(LossStringDllId); buffer.WriteUInteger(HistoryStringDllId); buffer.WriteUInteger(ScoutsStringDllId); buffer.WriteShort((short)InstructionsString.Length); buffer.WriteString(InstructionsString); buffer.WriteShort((short)HintsString.Length); buffer.WriteString(HintsString); buffer.WriteShort((short)VictoryString.Length); buffer.WriteString(VictoryString); buffer.WriteShort((short)LossString.Length); buffer.WriteString(LossString); buffer.WriteShort((short)HistoryString.Length); buffer.WriteString(HistoryString); buffer.WriteShort((short)ScoutsString.Length); buffer.WriteString(ScoutsString); buffer.WriteShort((short)PregameCinematicFileName.Length); buffer.WriteString(PregameCinematicFileName); buffer.WriteShort((short)VictoryCinematicFileName.Length); buffer.WriteString(VictoryCinematicFileName); buffer.WriteShort((short)LossCinematicFileName.Length); buffer.WriteString(LossCinematicFileName); buffer.WriteShort((short)BackgroundFileName.Length); buffer.WriteString(BackgroundFileName); if (Bitmap == null) { buffer.WriteUInteger(0); buffer.WriteInteger(0); buffer.WriteInteger(0); buffer.WriteShort(1); } else { buffer.WriteUInteger(1); buffer.WriteInteger(Bitmap.Width); buffer.WriteInteger(Bitmap.Height); buffer.WriteShort(-1); Bitmap.SaveToBuffer(buffer, false); } }
public void WriteData(RAMBuffer buffer) { buffer.WriteByte(Enabled); buffer.WriteByte(Random); buffer.WriteString(Name, 13); buffer.WriteString(Name2, 13); buffer.WriteInteger(SLP); buffer.WriteInteger(ShapePtr); buffer.WriteInteger(SoundID); buffer.WriteInteger(BlendPriority); buffer.WriteInteger(BlendType); AssertListLength(Colors, 3); Colors.ForEach(col => buffer.WriteByte(col)); buffer.WriteByte(CliffColors.Item1); buffer.WriteByte(CliffColors.Item2); buffer.WriteByte(PassableTerrain); buffer.WriteByte(ImpassableTerrain); buffer.WriteByte(IsAnimated); buffer.WriteShort(AnimationFrames); buffer.WriteShort(PauseFames); buffer.WriteFloat(Interval); buffer.WriteFloat(PauseBetweenLoops); buffer.WriteShort(Frame); buffer.WriteShort(DrawFrame); buffer.WriteFloat(AnimateLast); buffer.WriteByte(FrameChanged); buffer.WriteByte(Drawn); AssertListLength(ElevationGraphics, 19); ElevationGraphics.ForEach(eg => eg.WriteData(buffer)); buffer.WriteShort(TerrainToDraw); buffer.WriteShort(TerrainDimensions.Item1); buffer.WriteShort(TerrainDimensions.Item2); Borders.ForEach(b => buffer.WriteShort(b)); AssertListLength(TerrainUnitID, 30); TerrainUnitID.ForEach(tu => buffer.WriteShort(tu)); AssertListLength(TerrainUnitDensity, 30); TerrainUnitDensity.ForEach(tu => buffer.WriteShort(tu)); AssertListLength(TerrainUnitCentering, 30); TerrainUnitCentering.ForEach(tu => buffer.WriteByte(tu)); buffer.WriteShort(NumberOfTerrainUnitsUsed); buffer.WriteShort(Phantom); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(One); buffer.WriteShort(ID); buffer.WriteByte(Unknown1); buffer.WriteShort(Type); buffer.WriteShort(ClassID); buffer.WriteShort(UnitID); buffer.WriteShort(TerrainID); buffer.WriteShort(ResourceIn); buffer.WriteShort(ResourceProductivityMultiplier); buffer.WriteShort(ResourceOut); buffer.WriteShort(Resource); buffer.WriteFloat(WorkRateMultiplier); buffer.WriteFloat(ExecutionRadius); buffer.WriteFloat(ExtraRange); buffer.WriteByte(Unknown4); buffer.WriteFloat(Unknown5); buffer.WriteByte(SelectionEnabler); buffer.WriteByte(Unknown7); buffer.WriteShort(PlunderSource); buffer.WriteShort(Unknown9); buffer.WriteByte(SelectionMode); buffer.WriteByte(RightClickMode); buffer.WriteByte(Unknown12); AssertListLength(Graphics, 6); Graphics.ForEach(e => buffer.WriteShort(e)); }
public void WriteData(RAMBuffer buffer) { buffer.WriteShort(ConstructionGraphicID); buffer.WriteShort(SnowGraphicID); buffer.WriteByte(AdjacentMode); buffer.WriteShort(GraphicsAngle); buffer.WriteByte(DisappearsWhenBuilt); buffer.WriteShort(StackUnitID); buffer.WriteShort(FoundationTerrainID); buffer.WriteShort(OldTerrainLikeID); buffer.WriteShort(ResearchID); buffer.WriteByte(Unknown33); AssertListLength(Annexes, 4); Annexes.ForEach(e => e.WriteData(buffer)); buffer.WriteShort(HeadUnit); buffer.WriteShort(TransformUnit); buffer.WriteShort(UnknownSound); buffer.WriteShort(ConstructionSound); buffer.WriteByte(GarrisonType); buffer.WriteFloat(GarrisonHealRateFactor); buffer.WriteFloat(Unknown35); buffer.WriteShort(PileUnit); AssertListLength(LootingTable, 6); LootingTable.ForEach(e => buffer.WriteByte(e)); }
public void WriteData(RAMBuffer buffer) { buffer.WriteInteger(VirtualFunctionPtr); buffer.WriteInteger(MapPointer); buffer.WriteInteger(MapWidth); buffer.WriteInteger(MapHeight); buffer.WriteInteger(WorldWidth); buffer.WriteInteger(WorldHeight); AssertListLength(TileSizes, 19); TileSizes.ForEach(ts => ts.WriteData(buffer)); buffer.WriteShort(PaddingTS); Terrains.ForEach(t => t.WriteData(buffer)); AssertListLength(TerrainBorders, 16); TerrainBorders.ForEach(tb => tb.WriteData(buffer)); buffer.WriteInteger(MapRowOffset); buffer.WriteFloat(MapMinX); buffer.WriteFloat(MapMinY); buffer.WriteFloat(MapMaxX); buffer.WriteFloat(MapMaxY); buffer.WriteFloat(MapMaxXplus1); buffer.WriteFloat(MapMaxYplus1); buffer.WriteUShort(TerrainsUsed2); buffer.WriteUShort(BordersUsed); buffer.WriteShort(MaxTerrain); buffer.WriteShort(TileWidth); buffer.WriteShort(TileHeight); buffer.WriteShort(TileHalfHeight); buffer.WriteShort(TileHalfWidth); buffer.WriteShort(ElevHeight); buffer.WriteShort(CurRow); buffer.WriteShort(CurCol); buffer.WriteShort(BlockBegRow); buffer.WriteShort(BlockEndRow); buffer.WriteShort(BlockBegCol); buffer.WriteShort(BlockEndCol); buffer.WriteInteger(SearchMapPtr); buffer.WriteInteger(SearchMapRowsPtr); buffer.WriteByte(AnyFrameChange); buffer.WriteByte(MapVisibleFlag); buffer.WriteByte(FogFlag); AssertListLength(SomeBytes, 21); SomeBytes.ForEach(b => buffer.WriteByte(b)); AssertListLength(SomeInt32, 157); SomeInt32.ForEach(i => buffer.WriteInteger(i)); }