Ejemplo n.º 1
0
 internal void ReadFrom(BinaryReader reader, MapInfoFormatVersion formatVersion)
 {
     Players      = reader.ReadBitmask32();
     Id           = reader.ReadInt32();
     Level        = reader.ReadInt32();
     Availability = reader.ReadInt32 <UpgradeAvailability>();
 }
Ejemplo n.º 2
0
 internal void WriteTo(BinaryWriter writer, MapInfoFormatVersion formatVersion)
 {
     writer.Write(Players);
     writer.Write(Id);
     writer.Write(Level);
     writer.Write((int)Availability);
 }
Ejemplo n.º 3
0
 internal void WriteTo(BinaryWriter writer, MapInfoFormatVersion formatVersion)
 {
     writer.Write(Chance);
     for (nint i = 0; i < UnitIds.Length; i++)
     {
         writer.Write(UnitIds[i]);
     }
 }
Ejemplo n.º 4
0
 internal void ReadFrom(BinaryReader reader, MapInfoFormatVersion formatVersion)
 {
     Chance = reader.ReadInt32();
     for (nint i = 0; i < UnitIds.Length; i++)
     {
         UnitIds[i] = reader.ReadInt32();
     }
 }
Ejemplo n.º 5
0
        internal void ReadFrom(BinaryReader reader, MapInfoFormatVersion formatVersion)
        {
            Id                    = reader.ReadInt32();
            Controller            = reader.ReadInt32 <PlayerController>();
            Race                  = reader.ReadInt32 <PlayerRace>();
            Flags                 = reader.ReadInt32 <PlayerFlags>();
            Name                  = reader.ReadChars();
            StartPosition         = new Vector2(reader.ReadSingle(), reader.ReadSingle());
            AllyLowPriorityFlags  = reader.ReadBitmask32();
            AllyHighPriorityFlags = reader.ReadBitmask32();

            if (formatVersion >= MapInfoFormatVersion.Reforged)
            {
                Unk1 = reader.ReadInt32();
                Unk2 = reader.ReadInt32();
            }
        }
Ejemplo n.º 6
0
        internal void WriteTo(BinaryWriter writer, MapInfoFormatVersion formatVersion)
        {
            writer.Write(Id);
            writer.Write((int)Controller);
            writer.Write((int)Race);
            writer.Write((int)Flags);
            writer.WriteString(Name);
            writer.Write(StartPosition.X);
            writer.Write(StartPosition.Y);
            writer.Write(AllyLowPriorityFlags);
            writer.Write(AllyHighPriorityFlags);

            if (formatVersion >= MapInfoFormatVersion.Reforged)
            {
                writer.Write(Unk1);
                writer.Write(Unk2);
            }
        }
Ejemplo n.º 7
0
 internal void WriteTo(BinaryWriter writer, MapInfoFormatVersion formatVersion)
 {
     writer.Write((int)Flags);
     writer.Write(Players);
     writer.WriteString(Name);
 }
Ejemplo n.º 8
0
 internal RandomItemTable(BinaryReader reader, MapInfoFormatVersion formatVersion)
 {
     ReadFrom(reader, formatVersion);
 }
Ejemplo n.º 9
0
 internal void ReadFrom(BinaryReader reader, MapInfoFormatVersion formatVersion)
 {
     Players = reader.ReadBitmask32();
     Id      = reader.ReadInt32();
 }
Ejemplo n.º 10
0
 public static RandomUnitSet ReadRandomUnitSet(this BinaryReader reader, MapInfoFormatVersion formatVersion, int setSize) => new RandomUnitSet(reader, formatVersion, setSize);
Ejemplo n.º 11
0
 public static TechData ReadTechData(this BinaryReader reader, MapInfoFormatVersion formatVersion) => new TechData(reader, formatVersion);
Ejemplo n.º 12
0
 public static ForceData ReadForceData(this BinaryReader reader, MapInfoFormatVersion formatVersion) => new ForceData(reader, formatVersion);
Ejemplo n.º 13
0
 internal void WriteTo(BinaryWriter writer, MapInfoFormatVersion formatVersion)
 {
     writer.Write(Chance);
     writer.Write(ItemId);
 }
Ejemplo n.º 14
0
 internal void ReadFrom(BinaryReader reader, MapInfoFormatVersion formatVersion)
 {
     Chance = reader.ReadInt32();
     ItemId = reader.ReadInt32();
 }
Ejemplo n.º 15
0
 internal RandomUnitSet(BinaryReader reader, MapInfoFormatVersion formatVersion, int setSize)
 {
     UnitIds = new int[setSize];
     ReadFrom(reader, formatVersion);
 }
Ejemplo n.º 16
0
 public static RandomItemSetItem ReadRandomItemSetItem(this BinaryReader reader, MapInfoFormatVersion formatVersion) => new RandomItemSetItem(reader, formatVersion);
Ejemplo n.º 17
0
 public static PlayerData ReadPlayerData(this BinaryReader reader, MapInfoFormatVersion formatVersion) => new PlayerData(reader, formatVersion);
Ejemplo n.º 18
0
 public static void Write(this BinaryWriter writer, RandomItemSetItem randomItemSetItem, MapInfoFormatVersion formatVersion) => randomItemSetItem.WriteTo(writer, formatVersion);
Ejemplo n.º 19
0
 public static UpgradeData ReadUpgradeData(this BinaryReader reader, MapInfoFormatVersion formatVersion) => new UpgradeData(reader, formatVersion);
Ejemplo n.º 20
0
 public static void Write(this BinaryWriter writer, PlayerData playerData, MapInfoFormatVersion formatVersion) => playerData.WriteTo(writer, formatVersion);
Ejemplo n.º 21
0
 public static RandomItemTable ReadRandomItemTable(this BinaryReader reader, MapInfoFormatVersion formatVersion) => new RandomItemTable(reader, formatVersion);
Ejemplo n.º 22
0
 public static void Write(this BinaryWriter writer, ForceData forceData, MapInfoFormatVersion formatVersion) => forceData.WriteTo(writer, formatVersion);
Ejemplo n.º 23
0
 public static void Write(this BinaryWriter writer, UpgradeData upgradeData, MapInfoFormatVersion formatVersion) => upgradeData.WriteTo(writer, formatVersion);
Ejemplo n.º 24
0
 public static void Write(this BinaryWriter writer, TechData techData, MapInfoFormatVersion formatVersion) => techData.WriteTo(writer, formatVersion);
Ejemplo n.º 25
0
 internal TechData(BinaryReader reader, MapInfoFormatVersion formatVersion)
 {
     ReadFrom(reader, formatVersion);
 }
Ejemplo n.º 26
0
 public static void Write(this BinaryWriter writer, RandomItemTable randomItemTable, MapInfoFormatVersion formatVersion) => randomItemTable.WriteTo(writer, formatVersion);
Ejemplo n.º 27
0
 internal void WriteTo(BinaryWriter writer, MapInfoFormatVersion formatVersion)
 {
     writer.Write(Players);
     writer.Write(Id);
 }
Ejemplo n.º 28
0
 public static void Write(this BinaryWriter writer, RandomUnitSet randomUnitSet, MapInfoFormatVersion formatVersion) => randomUnitSet.WriteTo(writer, formatVersion);
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapInfo"/> class.
 /// </summary>
 /// <param name="formatVersion"></param>
 public MapInfo(MapInfoFormatVersion formatVersion)
 {
     FormatVersion = formatVersion;
 }
Ejemplo n.º 30
0
 internal void ReadFrom(BinaryReader reader, MapInfoFormatVersion formatVersion)
 {
     Flags   = reader.ReadInt32 <ForceFlags>();
     Players = reader.ReadBitmask32();
     Name    = reader.ReadChars();
 }