public void WriteTo(System.IO.BinaryWriter writer) { writer.Write(MyId); writer.Write(MapSize); writer.Write(FogOfWar); writer.Write(EntityProperties.Count); foreach (var EntityPropertiesEntry in EntityProperties) { var EntityPropertiesKey = EntityPropertiesEntry.Key; var EntityPropertiesValue = EntityPropertiesEntry.Value; writer.Write((int)(EntityPropertiesKey)); EntityPropertiesValue.WriteTo(writer); } writer.Write(MaxTickCount); writer.Write(MaxPathfindNodes); writer.Write(CurrentTick); writer.Write(Players.Length); foreach (var PlayersElement in Players) { PlayersElement.WriteTo(writer); } writer.Write(Entities.Length); foreach (var EntitiesElement in Entities) { EntitiesElement.WriteTo(writer); } }
public void WriteTo(System.IO.BinaryWriter writer) { writer.Write(CurrentTick); Properties.WriteTo(writer); Level.WriteTo(writer); writer.Write(Players.Length); foreach (var PlayersElement in Players) { PlayersElement.WriteTo(writer); } writer.Write(Units.Length); foreach (var UnitsElement in Units) { UnitsElement.WriteTo(writer); } writer.Write(Bullets.Length); foreach (var BulletsElement in Bullets) { BulletsElement.WriteTo(writer); } writer.Write(Mines.Length); foreach (var MinesElement in Mines) { MinesElement.WriteTo(writer); } writer.Write(LootBoxes.Length); foreach (var LootBoxesElement in LootBoxes) { LootBoxesElement.WriteTo(writer); } }