Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KillLogItem"/> class.
        /// </summary>
        /// <param name="src">The source.</param>
        /// <param name="isInContainer">if set to <c>true</c> item is in container.</param>
        internal KillLogItem(SerializableKillLogItemListItem src, bool isInContainer = false)
        {
            m_typeID     = src.TypeID;
            EVEFlag      = src.EVEFlag;
            QtyDestroyed = src.QtyDestroyed;
            QtyDropped   = src.QtyDropped;
            Singleton    = src.Singleton;
            Item         = StaticItems.GetItemByID(src.TypeID);

            FittingContentGroup = GetFittingContentGroup();
            IsInContainer       = isInContainer;

            m_items.AddRange(src.Items.Select(item => new KillLogItem(item, true)));
        }
Esempio n. 2
0
        /// <summary>
        /// Exports this object to a serializable form.
        /// </summary>
        /// <returns>The SerializableKillLogItemListItem representing this object.</returns>
        public SerializableKillLogItemListItem Export()
        {
            var exported = new SerializableKillLogItemListItem()
            {
                EVEFlag      = EVEFlag,
                QtyDestroyed = QtyDestroyed,
                QtyDropped   = QtyDropped,
                Singleton    = Singleton,
                TypeID       = m_typeID
            };

            // Recursively export contained items
            foreach (var item in m_items)
            {
                exported.Items.Add(item.Export());
            }
            return(exported);
        }
        public SerializableKillLogItemListItem ToXMLItem()
        {
            var ret = new SerializableKillLogItemListItem()
            {
                TypeID       = TypeID,
                QtyDestroyed = QtyDestroyed,
                QtyDropped   = QtyDropped,
                Singleton    = Singleton,
                EVEFlag      = EVEFlag
            };

            // Nested items
            if (Items != null)
            {
                foreach (var item in Items)
                {
                    ret.Items.Add(item.ToXMLItem());
                }
            }

            return(ret);
        }