Пример #1
0
        public override void Serialize(IDataWriter writer)
        {
            base.Serialize(writer);
            writer.WriteShort(((short)(m_additional.Count)));
            int additionalIndex;

            for (additionalIndex = 0; (additionalIndex < m_additional.Count); additionalIndex = (additionalIndex + 1))
            {
                FightResultAdditionalData objectToSend = m_additional[additionalIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteSByte(m_level);
        }
Пример #2
0
        public override void Deserialize(IDataReader reader)
        {
            base.Deserialize(reader);
            m_level = reader.ReadSByte();
            int additionalCount = reader.ReadUShort();
            int additionalIndex;

            m_additional = new System.Collections.Generic.List <FightResultAdditionalData>();
            for (additionalIndex = 0; (additionalIndex < additionalCount); additionalIndex = (additionalIndex + 1))
            {
                FightResultAdditionalData objectToAdd = ProtocolTypeManager.GetInstance <FightResultAdditionalData>(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_additional.Add(objectToAdd);
            }
        }