示例#1
0
        void UpdateEquipmentGrid(DataEquipmentInformation[] EquipList)
        {
            int filterTypeLowerBound;
            int filterTypeUpperBound;

            if (comboBoxFilterType.SelectedIndex.Equals((int)ViewFilterTypeComboIndex.All))
            {
                filterTypeLowerBound = 0; //If "All" filter selected, select all item types (specifically those within index range 0-99).
                filterTypeUpperBound = 99;
            }
            else   //If any other filter selected, set upper and lower bound of item types to that specific type.
            {
                filterTypeLowerBound = comboBoxFilterType.SelectedIndex;
                filterTypeUpperBound = comboBoxFilterType.SelectedIndex;
            }
            mEquipments = EquipList;
            dataGridViewEquipment.Rows.Clear();
            foreach (DataEquipmentInformation equip in EquipList)
            {
                //If "All" selected, chooses all item types from 0-99, if "Weapon" is selected, chooses item types in range 1-1 (i.e. =1).
                if (((int)equip.Type >= filterTypeLowerBound) && ((int)equip.Type <= filterTypeUpperBound) &&
                    (equip.Category != SchemaConstants.EquipmentCategory.ArmorUpgrade) &&     //Exclude Armour upgrade mats from "Armour" filter.
                    (equip.Category != SchemaConstants.EquipmentCategory.WeaponUpgrade))        //Exclude Weapon upgrade mats from "Weapon" filter.
                {
                    int             row_index = dataGridViewEquipment.Rows.Add();
                    DataGridViewRow row       = dataGridViewEquipment.Rows[row_index];
                    row.Tag = equip;
                    row.Cells[dgcItemID.Name].Value   = equip.EquipmentId;
                    row.Cells[dgcItem.Name].Value     = equip.Name;
                    row.Cells[dgcCategory.Name].Value = equip.Category;
                    row.Cells[dgcType.Name].Value     = equip.Type;
                    row.Cells[dgcRarity.Name].Value   = new RarityColumnValue((int)equip.BaseRarity, (int)equip.EvolutionNumber);
                    row.Cells[dgcSynergy.Name].Value  = new SynergyColumnValue(RealmSynergy.FromSeries(equip.SeriesId));
                    row.Cells[dgcLevel.Name].Value    = new LevelColumnValue(equip.Level, equip.LevelMax);
                    row.Cells[dgcAugments.Name].Value = new AugmentColumnValue(equip.Augment, equip.AugmentMax);
                    if (mAnalyzer != null)
                    {
                        row.Cells[dgcScore.Name].Value = new ScoreColumnValue(mAnalyzer.GetScore(equip.InstanceId));
                    }

                    GridEquipStats stats = ComputeDisplayStats(equip);
                    SetStatsForRow(row, equip, stats);
                }
            }
        }
示例#2
0
        void UpdateEquipmentGrid(DataEquipmentInformation[] EquipList)
        {
            mEquipments = EquipList;
            dataGridViewEquipment.Rows.Clear();
            foreach (DataEquipmentInformation equip in EquipList)
            {
                int             row_index = dataGridViewEquipment.Rows.Add();
                DataGridViewRow row       = dataGridViewEquipment.Rows[row_index];
                row.Tag = equip;
                row.Cells[dgcItemID.Name].Value   = equip.EquipmentId;
                row.Cells[dgcItem.Name].Value     = equip.Name;
                row.Cells[dgcCategory.Name].Value = equip.Category;
                row.Cells[dgcType.Name].Value     = equip.Type;
                row.Cells[dgcRarity.Name].Value   = new RarityColumnValue((int)equip.BaseRarity, (int)equip.EvolutionNumber);
                row.Cells[dgcSynergy.Name].Value  = new SynergyColumnValue(RealmSynergy.FromSeries(equip.SeriesId));
                row.Cells[dgcLevel.Name].Value    = new LevelColumnValue(equip.Level, equip.LevelMax);
                row.Cells[dgcScore.Name].Value    = new ScoreColumnValue(mAnalyzer.GetScore(equip.InstanceId));

                GridEquipStats stats = ComputeDisplayStats(equip);
                SetStatsForRow(row, equip, stats);
            }
        }