Ejemplo n.º 1
0
        public override void Serialize(IDataWriter writer)
        {
            writer.WriteShort(((short)(m_objects.Count)));
            int objectsIndex;

            for (objectsIndex = 0; (objectsIndex < m_objects.Count); objectsIndex = (objectsIndex + 1))
            {
                PresetItem objectToSend = m_objects[objectsIndex];
                objectToSend.Serialize(writer);
            }
            writer.WriteByte(m_presetId);
            writer.WriteByte(m_symbolId);
            writer.WriteBoolean(m_mount);
        }
Ejemplo n.º 2
0
        public override void Deserialize(IDataReader reader)
        {
            m_presetId = reader.ReadByte();
            m_symbolId = reader.ReadByte();
            m_mount    = reader.ReadBoolean();
            int objectsCount = reader.ReadUShort();
            int objectsIndex;

            m_objects = new System.Collections.Generic.List <PresetItem>();
            for (objectsIndex = 0; (objectsIndex < objectsCount); objectsIndex = (objectsIndex + 1))
            {
                PresetItem objectToAdd = new PresetItem();
                objectToAdd.Deserialize(reader);
                m_objects.Add(objectToAdd);
            }
        }