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

            for (objectivesIndex = 0; (objectivesIndex < m_objectives.Count); objectivesIndex = (objectivesIndex + 1))
            {
                QuestObjectiveInformations objectToSend = m_objectives[objectivesIndex];
                writer.WriteUShort(((ushort)(objectToSend.TypeID)));
                objectToSend.Serialize(writer);
            }
            writer.WriteVarShort(m_stepId);
        }
Пример #2
0
        public override void Deserialize(IDataReader reader)
        {
            base.Deserialize(reader);
            int objectivesCount = reader.ReadUShort();
            int objectivesIndex;

            m_objectives = new System.Collections.Generic.List <QuestObjectiveInformations>();
            for (objectivesIndex = 0; (objectivesIndex < objectivesCount); objectivesIndex = (objectivesIndex + 1))
            {
                QuestObjectiveInformations objectToAdd = ProtocolTypeManager.GetInstance <QuestObjectiveInformations>(reader.ReadUShort());
                objectToAdd.Deserialize(reader);
                m_objectives.Add(objectToAdd);
            }
            m_stepId = reader.ReadVarUhShort();
        }