Exemple #1
0
        /// <summary>
        /// Base deserialization constructor.
        /// </summary>
        /// <param name="src"></param>
        internal Item(MarketGroup group, SerializableItem src)
            : this(src.ID, src.Name)
        {
            m_marketGroup = group;

            m_icon        = src.Icon;
            m_race        = src.Race;
            m_slot        = src.Slot;
            m_family      = src.Family;
            m_description = src.Description;

            m_metaLevel = src.MetaLevel;
            m_metaGroup = src.MetaGroup;

            m_reprocessing = new FastList <Material>(0);
            m_properties   = new PropertiesCollection(src.Properties);

            // Skills prerequisites
            m_prerequisites = new FastList <StaticSkillLevel>((src.Prereqs != null ? src.Prereqs.Length : 0));
            if (src.Prereqs == null)
            {
                return;
            }

            foreach (var prereq in src.Prereqs)
            {
                m_prerequisites.Add(new StaticSkillLevel(prereq.ID, prereq.Level));
            }
        }
Exemple #2
0
        /// <summary>
        /// Base constructor for blueprints.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        internal Item(BlueprintMarketGroup group, SerializableBlueprint src)
            : this(src.ID, src.Name)
        {
            m_icon = src.Icon;
            m_metaGroup = src.MetaGroup;
            m_marketGroup = group;
            m_family = ItemFamily.Bpo;

            m_prerequisites = new FastList<StaticSkillLevel>(src.PrereqSkill != null ? src.PrereqSkill.Length : 0);
            if (src.PrereqSkill == null)
                return;

            foreach (var prereq in src.PrereqSkill)
            {
                m_prerequisites.Add(new StaticSkillLevel(prereq.ID, prereq.Level, prereq.Activity));
            }
        }
Exemple #3
0
        /// <summary>
        /// Base constructor for blueprints.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        internal Item(BlueprintMarketGroup group, SerializableBlueprint src)
            : this(src.ID, src.Name)
        {
            m_icon        = src.Icon;
            m_metaGroup   = src.MetaGroup;
            m_marketGroup = group;
            m_family      = ItemFamily.Bpo;

            m_prerequisites = new FastList <StaticSkillLevel>(src.PrereqSkill != null ? src.PrereqSkill.Length : 0);
            if (src.PrereqSkill == null)
            {
                return;
            }

            foreach (var prereq in src.PrereqSkill)
            {
                m_prerequisites.Add(new StaticSkillLevel(prereq.ID, prereq.Level, prereq.Activity));
            }
        }
Exemple #4
0
        /// <summary>
        /// When one of the metagroups combo is checked/unchecked, we update the settings and the control content.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cbMetagroup_CheckedChanged(object sender, EventArgs e)
        {
            // Retrieve the metagroup
            ItemMetaGroup metagroup = ItemMetaGroup.Empty;

            if (cbTech1.Checked)
            {
                metagroup |= ItemMetaGroup.T1;
            }
            if (cbTech2.Checked)
            {
                metagroup |= ItemMetaGroup.T2;
            }
            if (cbTech3.Checked)
            {
                metagroup |= ItemMetaGroup.T3;
            }
            if (cbFaction.Checked)
            {
                metagroup |= ItemMetaGroup.Faction;
            }
            if (cbStoryline.Checked)
            {
                metagroup |= ItemMetaGroup.Storyline;
            }
            if (cbOfficer.Checked)
            {
                metagroup |= ItemMetaGroup.Officer;
            }

            // Update the settings
            Settings.UI.BlueprintBrowser.MetagroupFilter |= metagroup;

            // Update the predicate
            m_metaGroupPredicate = (x) => (x.MetaGroup & metagroup) != ItemMetaGroup.Empty;

            // Update content
            UpdateContent();
        }
Exemple #5
0
        /// <summary>
        /// When the meta group combo changed, we update the settings, the predicate and the content.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ccbGroupFilter_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            // Update the control's content
            if (!m_init)
            {
                return;
            }

            // Update the predicate
            ItemMetaGroup filter = m_metaGroups
                                   .Where((t, i) => ccbGroupFilter.GetItemChecked(i))
                                   .Aggregate(ItemMetaGroup.None, (current, t) => current | t);

            m_metaGroupPredicate = x => (x.MetaGroup & filter) != ItemMetaGroup.None;

            // Update content
            UpdateContent();

            ItemBrowserSettings settings;

            // Skill Planner
            if (Plan != null)
            {
                settings = Settings.UI.ItemBrowser;
            }
            // Character associated Data Browser
            else if (Character != null)
            {
                settings = Settings.UI.ItemCharacterDataBrowser;
            }
            // Data Browser
            else
            {
                settings = Settings.UI.ItemDataBrowser;
            }

            settings.MetagroupFilter = filter;
        }
        /// <summary>
        /// When one of the metagroups combo is checked/unchecked, we update the settings and the control content.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cbMetagroup_CheckedChanged(object sender, EventArgs e)
        {
            // Update the control's content
            if (!m_init)
            {
                return;
            }

            // Retrieve the metagroup
            ItemMetaGroup metagroup = ItemMetaGroup.None;

            if (cbTech1.Checked)
            {
                metagroup |= ItemMetaGroup.T1;
            }
            if (cbTech2.Checked)
            {
                metagroup |= ItemMetaGroup.T2;
            }
            if (cbTech3.Checked)
            {
                metagroup |= ItemMetaGroup.T3;
            }
            if (cbFaction.Checked)
            {
                metagroup |= ItemMetaGroup.Faction;
            }
            if (cbStoryline.Checked)
            {
                metagroup |= ItemMetaGroup.Storyline;
            }
            if (cbOfficer.Checked)
            {
                metagroup |= ItemMetaGroup.Officer;
            }

            // Update the predicate
            m_metaGroupPredicate = x => (x.MetaGroup & metagroup) != ItemMetaGroup.None;

            // Update content
            UpdateContent();

            BlueprintBrowserSettings settings;

            // Skill Planner
            if (Plan != null)
            {
                settings = Settings.UI.BlueprintBrowser;
            }
            // Character associated Data Browser
            else if (Character != null)
            {
                settings = Settings.UI.BlueprintCharacterDataBrowser;
            }
            // Data Browser
            else
            {
                settings = Settings.UI.BlueprintDataBrowser;
            }

            // Update the settings
            settings.MetagroupFilter |= metagroup;
        }
Exemple #7
0
        /// <summary>
        /// Base deserialization constructor.
        /// </summary>
        /// <param name="src"></param>
        internal Item(MarketGroup group, SerializableItem src)
            : this(src.ID, src.Name)
        {
            m_marketGroup = group;

            m_icon = src.Icon;
            m_race = src.Race;
            m_slot = src.Slot;
            m_family = src.Family;
            m_description = src.Description;

            m_metaLevel = src.MetaLevel;
            m_metaGroup = src.MetaGroup;

            m_reprocessing = new FastList<Material>(0);
            m_properties = new PropertiesCollection(src.Properties);

            // Skills prerequisites
            m_prerequisites = new FastList<StaticSkillLevel>((src.Prereqs != null ? src.Prereqs.Length : 0));
            if (src.Prereqs == null)
                return;

            foreach (var prereq in src.Prereqs)
            {
                m_prerequisites.Add(new StaticSkillLevel(prereq.ID, prereq.Level));
            }
        }