public override void Deserialize(IDataReader reader)
        {
            fightId = reader.ReadInt();
            if (fightId < 0)
            {
                throw new Exception("Forbidden value on fightId = " + fightId + ", it doesn't respect the following condition : fightId < 0");
            }
            var limit      = reader.ReadShort();
            var attackers_ = new GameFightFighterLightInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                attackers_[i] = Types.ProtocolTypeManager.GetInstance <GameFightFighterLightInformations>(reader.ReadShort());
                attackers_[i].Deserialize(reader);
            }
            attackers = attackers_;
            limit     = reader.ReadShort();
            var defenders_ = new GameFightFighterLightInformations[limit];

            for (int i = 0; i < limit; i++)
            {
                defenders_[i] = Types.ProtocolTypeManager.GetInstance <GameFightFighterLightInformations>(reader.ReadShort());
                defenders_[i].Deserialize(reader);
            }
            defenders = defenders_;
        }
 public void Deserialize(IDataReader reader)
 {
     FightId   = (UInt32)reader.ReadInt();
     Attackers = new GameFightFighterLightInformations[reader.ReadShort()];
     for (var i = 0; i < Attackers.Length; i++)
     {
         (Attackers[i] = new GameFightFighterLightInformations()).Deserialize(reader);
     }
     Defenders = new GameFightFighterLightInformations[reader.ReadShort()];
     for (var i = 0; i < Defenders.Length; i++)
     {
         (Defenders[i] = new GameFightFighterLightInformations()).Deserialize(reader);
     }
 }
 public override void Serialize(IDataWriter writer)
 {
     writer.WriteInt(this.fightId);
     writer.WriteShort((short)((int)this.attackers.Length));
     GameFightFighterLightInformations[] gameFightFighterLightInformationsArray = this.attackers;
     for (int i = 0; i < (int)gameFightFighterLightInformationsArray.Length; i++)
     {
         GameFightFighterLightInformations gameFightFighterLightInformation = gameFightFighterLightInformationsArray[i];
         writer.WriteShort(gameFightFighterLightInformation.TypeId);
         gameFightFighterLightInformation.Serialize(writer);
     }
     writer.WriteShort((short)((int)this.defenders.Length));
     GameFightFighterLightInformations[] gameFightFighterLightInformationsArray1 = this.defenders;
     for (int j = 0; j < (int)gameFightFighterLightInformationsArray1.Length; j++)
     {
         GameFightFighterLightInformations gameFightFighterLightInformation1 = gameFightFighterLightInformationsArray1[j];
         writer.WriteShort(gameFightFighterLightInformation1.TypeId);
         gameFightFighterLightInformation1.Serialize(writer);
     }
 }
Example #4
0
        public override void Serialize(ICustomDataOutput writer)
        {
            writer.WriteShort(((short)(m_attackers.Count)));
            int attackersIndex;

            for (attackersIndex = 0; (attackersIndex < m_attackers.Count); attackersIndex = (attackersIndex + 1))
            {
                GameFightFighterLightInformations objectToSend = m_attackers[attackersIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteShort(((short)(m_defenders.Count)));
            int defendersIndex;

            for (defendersIndex = 0; (defendersIndex < m_defenders.Count); defendersIndex = (defendersIndex + 1))
            {
                GameFightFighterLightInformations objectToSend = m_defenders[defendersIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteInt(m_fightId);
        }
        public override void Deserialize(IDataReader reader)
        {
            FightId = reader.ReadVarUhShort();
            var AttackersCount = reader.ReadShort();

            Attackers = new List <GameFightFighterLightInformations>();
            for (var i = 0; i < AttackersCount; i++)
            {
                GameFightFighterLightInformations objectToAdd = ProtocolTypeManager.GetInstance(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                Attackers.Add(objectToAdd);
            }
            var DefendersCount = reader.ReadShort();

            Defenders = new List <GameFightFighterLightInformations>();
            for (var i = 0; i < DefendersCount; i++)
            {
                GameFightFighterLightInformations objectToAdd = ProtocolTypeManager.GetInstance(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                Defenders.Add(objectToAdd);
            }
        }
Example #6
0
        public override void Deserialize(ICustomDataInput reader)
        {
            int attackersCount = reader.ReadUShort();
            int attackersIndex;

            m_attackers = new System.Collections.Generic.List <GameFightFighterLightInformations>();
            for (attackersIndex = 0; (attackersIndex < attackersCount); attackersIndex = (attackersIndex + 1))
            {
                GameFightFighterLightInformations objectToAdd = ProtocolTypeManager.GetInstance <GameFightFighterLightInformations>((short)reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_attackers.Add(objectToAdd);
            }
            int defendersCount = reader.ReadUShort();
            int defendersIndex;

            m_defenders = new System.Collections.Generic.List <GameFightFighterLightInformations>();
            for (defendersIndex = 0; (defendersIndex < defendersCount); defendersIndex = (defendersIndex + 1))
            {
                GameFightFighterLightInformations objectToAdd = ProtocolTypeManager.GetInstance <GameFightFighterLightInformations>((short)reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_defenders.Add(objectToAdd);
            }
            m_fightId = reader.ReadInt();
        }
        public override void Deserialize(ICustomDataInput reader)
        {
            FightId = reader.ReadVarShort();
            var countAttackers = reader.ReadShort();

            Attackers = new List <GameFightFighterLightInformations>();
            for (short i = 0; i < countAttackers; i++)
            {
                var attackerstypeId = reader.ReadShort();
                GameFightFighterLightInformations type = new GameFightFighterLightInformations();
                type.Deserialize(reader);
                Attackers.Add(type);
            }
            var countDefenders = reader.ReadShort();

            Defenders = new List <GameFightFighterLightInformations>();
            for (short i = 0; i < countDefenders; i++)
            {
                var defenderstypeId = reader.ReadShort();
                GameFightFighterLightInformations type = new GameFightFighterLightInformations();
                type.Deserialize(reader);
                Defenders.Add(type);
            }
        }
        public override void Deserialize(IDataReader reader)
        {
            this.fightId = (uint)reader.ReadVarUhShort();
            if (this.fightId < 0U)
            {
                throw new Exception("Forbidden value (" + (object)this.fightId + ") on element of MapRunningFightDetailsMessage.fightId.");
            }
            uint num1 = (uint)reader.ReadUShort();

            for (int index = 0; (long)index < (long)num1; ++index)
            {
                GameFightFighterLightInformations instance = ProtocolTypeManager.GetInstance <GameFightFighterLightInformations>((uint)reader.ReadUShort());
                instance.Deserialize(reader);
                this.attackers.Add(instance);
            }
            uint num2 = (uint)reader.ReadUShort();

            for (int index = 0; (long)index < (long)num2; ++index)
            {
                GameFightFighterLightInformations instance = ProtocolTypeManager.GetInstance <GameFightFighterLightInformations>((uint)reader.ReadUShort());
                instance.Deserialize(reader);
                this.defenders.Add(instance);
            }
        }