Example #1
0
        public override void Deserialize(IDataReader reader)
        {
            int enabledSkillsCount = reader.ReadUShort();
            int enabledSkillsIndex;

            m_enabledSkills = new System.Collections.Generic.List <InteractiveElementSkill>();
            for (enabledSkillsIndex = 0; (enabledSkillsIndex < enabledSkillsCount); enabledSkillsIndex = (enabledSkillsIndex + 1))
            {
                InteractiveElementSkill objectToAdd = ProtocolManager.GetTypeInstance <InteractiveElementSkill>(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 = ProtocolManager.GetTypeInstance <InteractiveElementSkill>(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_disabledSkills.Add(objectToAdd);
            }
            m_elementId     = reader.ReadInt();
            m_elementTypeId = reader.ReadInt();
            m_onCurrentMap  = reader.ReadBoolean();
        }
Example #2
0
        public override void Serialize(IDataWriter writer)
        {
            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.WriteInt(m_elementId);
            writer.WriteInt(m_elementTypeId);
            writer.WriteBoolean(m_onCurrentMap);
        }