public void Serialize(GenericWriter writer)
        {
            writer.WriteEncodedInt((int)6);                // version

            writer.Write(m_LastAtrophy);

            // jakob, write deputy commander
            writer.Write(m_DeputyCommander != null);
            if (m_DeputyCommander != null)
            {
                writer.Write((Mobile)m_DeputyCommander);
            }
            // end

            writer.WriteEncodedInt((int)m_LastBroadcasts.Length);

            for (int i = 0; i < m_LastBroadcasts.Length; ++i)
            {
                writer.Write((DateTime)m_LastBroadcasts[i]);
            }

            m_Election.Serialize(writer);

            Faction.WriteReference(writer, m_Faction);

            writer.Write((Mobile)m_Commander);

            writer.WriteEncodedInt((int)m_Tithe);
            writer.WriteEncodedInt((int)m_Silver);

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

            for (int i = 0; i < m_Members.Count; ++i)
            {
                PlayerState pl = (PlayerState)m_Members[i];

                pl.Serialize(writer);
            }

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

            for (int i = 0; i < m_FactionItems.Count; ++i)
            {
                m_FactionItems[i].Serialize(writer);
            }

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

            for (int i = 0; i < m_FactionTraps.Count; ++i)
            {
                writer.Write((Item)m_FactionTraps[i]);
            }
        }
Beispiel #2
0
        public void Serialize(GenericWriter writer)
        {
            writer.WriteEncodedInt((int)5); // version

            writer.Write(m_LastAtrophy);

            writer.WriteEncodedInt(4);               // version

            writer.WriteEncodedInt(m_LastBroadcasts.Length);

            for (int i = 0; i < m_LastBroadcasts.Length; ++i)
            {
                writer.Write(m_LastBroadcasts[i]);
            }

            m_Election.Serialize(writer);

            Faction.WriteReference(writer, m_Faction);

            writer.Write(m_Commander);

            writer.WriteEncodedInt(m_Tithe);
            writer.WriteEncodedInt(m_Silver);

            writer.WriteEncodedInt(m_Members.Count);

            for (int i = 0; i < m_Members.Count; ++i)
            {
                PlayerState pl = m_Members[i];

                pl.Serialize(writer);
            }

            writer.WriteEncodedInt(m_FactionItems.Count);

            for (int i = 0; i < m_FactionItems.Count; ++i)
            {
                m_FactionItems[i].Serialize(writer);
            }

            writer.WriteEncodedInt(m_FactionTraps.Count);

            for (int i = 0; i < m_FactionTraps.Count; ++i)
            {
                writer.Write(m_FactionTraps[i]);
            }
        }