Ejemplo n.º 1
0
        public override void Deserialize(IDataReader reader)
        {
            m_fightId   = reader.ReadInt();
            m_fightType = reader.ReadByte();
            int fightTeamsCount = reader.ReadUShort();
            int fightTeamsIndex;

            m_fightTeams = new System.Collections.Generic.List <FightTeamInformations>();
            for (fightTeamsIndex = 0; (fightTeamsIndex < fightTeamsCount); fightTeamsIndex = (fightTeamsIndex + 1))
            {
                FightTeamInformations objectToAdd = ProtocolTypeManager.GetInstance <FightTeamInformations>(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_fightTeams.Add(objectToAdd);
            }
            int fightTeamsPositionsCount = reader.ReadUShort();
            int fightTeamsPositionsIndex;

            m_fightTeamsPositions = new System.Collections.Generic.List <ushort>();
            for (fightTeamsPositionsIndex = 0; (fightTeamsPositionsIndex < fightTeamsPositionsCount); fightTeamsPositionsIndex = (fightTeamsPositionsIndex + 1))
            {
                m_fightTeamsPositions.Add(reader.ReadVarUhShort());
            }
            int fightTeamsOptionsCount = reader.ReadUShort();
            int fightTeamsOptionsIndex;

            m_fightTeamsOptions = new System.Collections.Generic.List <FightOptionsInformations>();
            for (fightTeamsOptionsIndex = 0; (fightTeamsOptionsIndex < fightTeamsOptionsCount); fightTeamsOptionsIndex = (fightTeamsOptionsIndex + 1))
            {
                FightOptionsInformations objectToAdd = new FightOptionsInformations();
                objectToAdd.Deserialize(reader);
                m_fightTeamsOptions.Add(objectToAdd);
            }
        }
Ejemplo n.º 2
0
        public override void Serialize(IDataWriter writer)
        {
            writer.WriteShort(((short)(m_fightTeams.Count)));
            int fightTeamsIndex;

            for (fightTeamsIndex = 0; (fightTeamsIndex < m_fightTeams.Count); fightTeamsIndex = (fightTeamsIndex + 1))
            {
                FightTeamInformations objectToSend = m_fightTeams[fightTeamsIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteShort(((short)(m_fightTeamsPositions.Count)));
            int fightTeamsPositionsIndex;

            for (fightTeamsPositionsIndex = 0; (fightTeamsPositionsIndex < m_fightTeamsPositions.Count); fightTeamsPositionsIndex = (fightTeamsPositionsIndex + 1))
            {
                writer.WriteVarShort(m_fightTeamsPositions[fightTeamsPositionsIndex]);
            }
            writer.WriteShort(((short)(m_fightTeamsOptions.Count)));
            int fightTeamsOptionsIndex;

            for (fightTeamsOptionsIndex = 0; (fightTeamsOptionsIndex < m_fightTeamsOptions.Count); fightTeamsOptionsIndex = (fightTeamsOptionsIndex + 1))
            {
                FightOptionsInformations objectToSend = m_fightTeamsOptions[fightTeamsOptionsIndex];
                objectToSend.Serialize(writer);
            }
            writer.WriteInt(m_fightId);
            writer.WriteByte(m_fightType);
        }