Ejemplo n.º 1
0
        public override void Deserialize(IDataReader reader)
        {
            m_elementId     = reader.ReadInt();
            m_elementTypeId = reader.ReadInt();
            int enabledSkillsCount = reader.ReadUShort();
            int enabledSkillsIndex;

            m_enabledSkills = new System.Collections.Generic.List <InteractiveElementSkill>();
            for (enabledSkillsIndex = 0; (enabledSkillsIndex < enabledSkillsCount); enabledSkillsIndex = (enabledSkillsIndex + 1))
            {
                InteractiveElementSkill objectToAdd = ProtocolTypeManager.GetInstance <InteractiveElementSkill>((short)reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_enabledSkills.Add(objectToAdd);
            }
            int disabledSkillsCount = reader.ReadUShort();
            int disabledSkillsIndex;

            m_disabledSkills = new System.Collections.Generic.List <InteractiveElementSkill>();
            for (disabledSkillsIndex = 0; (disabledSkillsIndex < disabledSkillsCount); disabledSkillsIndex = (disabledSkillsIndex + 1))
            {
                InteractiveElementSkill objectToAdd = ProtocolTypeManager.GetInstance <InteractiveElementSkill>((short)reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_disabledSkills.Add(objectToAdd);
            }
            m_onCurrentMap = reader.ReadBoolean();
        }
Ejemplo n.º 2
0
        public override void Serialize(IDataWriter writer)
        {
            writer.WriteInt(m_elementId);
            writer.WriteInt(m_elementTypeId);
            writer.WriteShort(((short)(m_enabledSkills.Count)));
            int enabledSkillsIndex;

            for (enabledSkillsIndex = 0; (enabledSkillsIndex < m_enabledSkills.Count); enabledSkillsIndex = (enabledSkillsIndex + 1))
            {
                InteractiveElementSkill objectToSend = m_enabledSkills[enabledSkillsIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteShort(((short)(m_disabledSkills.Count)));
            int disabledSkillsIndex;

            for (disabledSkillsIndex = 0; (disabledSkillsIndex < m_disabledSkills.Count); disabledSkillsIndex = (disabledSkillsIndex + 1))
            {
                InteractiveElementSkill objectToSend = m_disabledSkills[disabledSkillsIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteBoolean(m_onCurrentMap);
        }