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

            for (finishedObjectiveIndex = 0; (finishedObjectiveIndex < m_finishedObjective.Count); finishedObjectiveIndex = (finishedObjectiveIndex + 1))
            {
                AchievementObjective objectToSend = m_finishedObjective[finishedObjectiveIndex];
                objectToSend.Serialize(writer);
            }
            writer.WriteShort(((short)(m_startedObjectives.Count)));
            int startedObjectivesIndex;

            for (startedObjectivesIndex = 0; (startedObjectivesIndex < m_startedObjectives.Count); startedObjectivesIndex = (startedObjectivesIndex + 1))
            {
                AchievementStartedObjective objectToSend = m_startedObjectives[startedObjectivesIndex];
                objectToSend.Serialize(writer);
            }
            writer.WriteVarUhShort(m_ObjectId);
        }
Пример #2
0
        public override void Deserialize(IDataReader reader)
        {
            int finishedObjectiveCount = reader.ReadUShort();
            int finishedObjectiveIndex;

            m_finishedObjective = new System.Collections.Generic.List <AchievementObjective>();
            for (finishedObjectiveIndex = 0; (finishedObjectiveIndex < finishedObjectiveCount); finishedObjectiveIndex = (finishedObjectiveIndex + 1))
            {
                AchievementObjective objectToAdd = new AchievementObjective();
                objectToAdd.Deserialize(reader);
                m_finishedObjective.Add(objectToAdd);
            }
            int startedObjectivesCount = reader.ReadUShort();
            int startedObjectivesIndex;

            m_startedObjectives = new System.Collections.Generic.List <AchievementStartedObjective>();
            for (startedObjectivesIndex = 0; (startedObjectivesIndex < startedObjectivesCount); startedObjectivesIndex = (startedObjectivesIndex + 1))
            {
                AchievementStartedObjective objectToAdd = new AchievementStartedObjective();
                objectToAdd.Deserialize(reader);
                m_startedObjectives.Add(objectToAdd);
            }
            m_ObjectId = reader.ReadVarUhShort();
        }