Ejemplo n.º 1
0
        public virtual void BaseDeserialize(GenericReader reader)
        {
            Type[] referenceTable = this.TypeReferenceTable;

            int version = reader.ReadEncodedInt();

            switch (version)
            {
            case 0:
            {
                int count = reader.ReadEncodedInt();

                m_Objectives = new ArrayList(count);

                for (int i = 0; i < count; ++i)
                {
                    QuestObjective obj = QuestSerializer.DeserializeObjective(referenceTable, reader);

                    if (obj != null)
                    {
                        obj.System = this;
                        m_Objectives.Add(obj);
                    }
                }

                count = reader.ReadEncodedInt();

                m_Conversations = new ArrayList(count);

                for (int i = 0; i < count; ++i)
                {
                    QuestConversation conv = QuestSerializer.DeserializeConversation(referenceTable, reader);

                    if (conv != null)
                    {
                        conv.System = this;
                        m_Conversations.Add(conv);
                    }
                }

                break;
            }
            }

            ChildDeserialize(reader);
        }
Ejemplo n.º 2
0
        public virtual void BaseDeserialize(IGenericReader reader)
        {
            var referenceTable = TypeReferenceTable;

            var version = reader.ReadEncodedInt();

            switch (version)
            {
            case 0:
            {
                var count = reader.ReadEncodedInt();

                Objectives = new List <QuestObjective>(count);

                for (var i = 0; i < count; ++i)
                {
                    var obj = QuestSerializer.DeserializeObjective(referenceTable, reader);

                    if (obj != null)
                    {
                        obj.System = this;
                        Objectives.Add(obj);
                    }
                }

                count = reader.ReadEncodedInt();

                Conversations = new List <QuestConversation>(count);

                for (var i = 0; i < count; ++i)
                {
                    var conv = QuestSerializer.DeserializeConversation(referenceTable, reader);

                    if (conv != null)
                    {
                        conv.System = this;
                        Conversations.Add(conv);
                    }
                }

                break;
            }
            }

            ChildDeserialize(reader);
        }
Ejemplo n.º 3
0
        public virtual void BaseSerialize(GenericWriter writer)
        {
            writer.WriteEncodedInt(0); // version

            writer.WriteEncodedInt(m_Objectives.Count);

            for (int i = 0; i < m_Objectives.Count; ++i)
            {
                QuestSerializer.Serialize(this, (QuestObjective)m_Objectives[i], writer);
            }

            writer.WriteEncodedInt(m_Conversations.Count);

            for (int i = 0; i < m_Conversations.Count; ++i)
            {
                QuestSerializer.Serialize(this, (QuestConversation)m_Conversations[i], writer);
            }

            ChildSerialize(writer);
        }
Ejemplo n.º 4
0
        public virtual void BaseSerialize(GenericWriter writer)
        {
            Type[] referenceTable = this.TypeReferenceTable;

            writer.WriteEncodedInt((int)0);                // version

            writer.WriteEncodedInt((int)m_Objectives.Count);

            for (int i = 0; i < m_Objectives.Count; ++i)
            {
                QuestSerializer.Serialize(referenceTable, (QuestObjective)m_Objectives[i], writer);
            }

            writer.WriteEncodedInt((int)m_Conversations.Count);

            for (int i = 0; i < m_Conversations.Count; ++i)
            {
                QuestSerializer.Serialize(referenceTable, (QuestConversation)m_Conversations[i], writer);
            }

            ChildSerialize(writer);
        }
Ejemplo n.º 5
0
        public virtual void BaseSerialize(IGenericWriter writer)
        {
            var referenceTable = TypeReferenceTable;

            writer.WriteEncodedInt(0); // version

            writer.WriteEncodedInt(Objectives.Count);

            for (var i = 0; i < Objectives.Count; ++i)
            {
                QuestSerializer.Serialize(referenceTable, Objectives[i], writer);
            }

            writer.WriteEncodedInt(Conversations.Count);

            for (var i = 0; i < Conversations.Count; ++i)
            {
                QuestSerializer.Serialize(referenceTable, Conversations[i], writer);
            }

            ChildSerialize(writer);
        }
Ejemplo n.º 6
0
        public virtual void BaseSerialize(GenericWriter writer)
        {
            Type[] referenceTable = TypeReferenceTable;

            writer.WriteEncodedInt(0);

            writer.WriteEncodedInt(Objectives.Count);

            for (int i = 0; i < Objectives.Count; ++i)
            {
                QuestSerializer.Serialize(referenceTable, (QuestObjective)Objectives[i], writer);
            }

            writer.WriteEncodedInt(Conversations.Count);

            for (int i = 0; i < Conversations.Count; ++i)
            {
                QuestSerializer.Serialize(referenceTable, (QuestConversation)Conversations[i], writer);
            }

            ChildSerialize(writer);
        }