Exemplo n.º 1
0
 public override void Serialize(IDataWriter writer)
 {
     writer.WriteShort((short)Alliances.Count);
     for (var alliancesIndex = 0; alliancesIndex < Alliances.Count; alliancesIndex++)
     {
         var objectToSend = Alliances[alliancesIndex];
         objectToSend.Serialize(writer);
     }
     writer.WriteShort((short)AllianceNbMembers.Count);
     for (var allianceNbMembersIndex = 0;
          allianceNbMembersIndex < AllianceNbMembers.Count;
          allianceNbMembersIndex++)
     {
         writer.WriteVarUhShort(AllianceNbMembers[allianceNbMembersIndex]);
     }
     writer.WriteShort((short)AllianceRoundWeigth.Count);
     for (var allianceRoundWeigthIndex = 0;
          allianceRoundWeigthIndex < AllianceRoundWeigth.Count;
          allianceRoundWeigthIndex++)
     {
         writer.WriteVarUhInt(AllianceRoundWeigth[allianceRoundWeigthIndex]);
     }
     writer.WriteShort((short)AllianceMatchScore.Count);
     for (var allianceMatchScoreIndex = 0;
          allianceMatchScoreIndex < AllianceMatchScore.Count;
          allianceMatchScoreIndex++)
     {
         writer.WriteByte(AllianceMatchScore[allianceMatchScoreIndex]);
     }
     AllianceMapWinner.Serialize(writer);
     writer.WriteVarUhInt(AllianceMapWinnerScore);
     writer.WriteVarUhInt(AllianceMapMyAllianceScore);
     writer.WriteDouble(NextTickTime);
 }
 public void Serialize(IDataWriter writer)
 {
     for (var i = 0; i < Alliances.Length; i++)
     {
         Alliances[i].Serialize(writer);
     }
     for (var i = 0; i < AllianceNbMembers.Length; i++)
     {
         writer.WriteVarShort((Int16)AllianceNbMembers[i]);
     }
     for (var i = 0; i < AllianceRoundWeigth.Length; i++)
     {
         writer.WriteVarInt((Int32)AllianceRoundWeigth[i]);
     }
     for (var i = 0; i < AllianceMatchScore.Length; i++)
     {
         writer.WriteByte(AllianceMatchScore[i]);
     }
     AllianceMapWinner.Serialize(writer);
     writer.WriteVarInt((Int32)AllianceMapWinnerScore);
     writer.WriteVarInt((Int32)AllianceMapMyAllianceScore);
     writer.WriteDouble(NextTickTime);
 }