Пример #1
0
        private void UpdateTreasureLandDict(ComboBoxWithDefault sender, IDictionary <PropositionType, BonusIndex> dict)
        {
            string          changed = sender.Tag.ToString();
            PropositionType type    = (PropositionType)Enum.Parse(typeof(PropositionType), changed);

            dict[type] = (BonusIndex)(sender.SelectedIndex);
        }
Пример #2
0
        private void UpdateBonusCashDict(ComboBoxWithDefault sender, TupleDictionary <PropositionType, BonusPercent, BonusIndex> dict)
        {
            string changed = sender.Tag.ToString();

            string[] sides      = changed.Split('.');
            string   errandType = sides[0];
            string   percentage = sides[1];

            BonusPercent    percent = (BonusPercent)Enum.Parse(typeof(BonusPercent), percentage);
            PropositionType type    = (PropositionType)Enum.Parse(typeof(PropositionType), errandType);

            dict[type, percent] = (BonusIndex)(sender.SelectedIndex);
        }
Пример #3
0
        private void SetValuesTreasureLandComboBoxes(
            IDictionary <PropositionType, BonusIndex> dict,
            IDictionary <PropositionType, BonusIndex> def,
            IList <ComboBoxWithDefault> boxes)
        {
            foreach (var box in boxes)
            {
                string tag = box.Tag.ToString();

                PropositionType type = (PropositionType)Enum.Parse(typeof(PropositionType), tag);

                box.SetIndexAndDefault((int)dict[type], (int)def[type]);
            }
        }
Пример #4
0
        private void SetValuesBonusCashComboBoxes(
            TupleDictionary <PropositionType, BonusPercent, BonusIndex> dict,
            TupleDictionary <PropositionType, BonusPercent, BonusIndex> def,
            IList <ComboBoxWithDefault> boxes)
        {
            foreach (var box in boxes)
            {
                string tag = box.Tag.ToString();

                string[] sides      = tag.Split('.');
                string   errandType = sides[0];
                string   percentage = sides[1];

                PropositionType type    = (PropositionType)Enum.Parse(typeof(PropositionType), errandType);
                BonusPercent    percent = (BonusPercent)Enum.Parse(typeof(BonusPercent), percentage);

                box.SetIndexAndDefault((int)dict[type, percent], (int)def[type, percent]);
            }
        }
Пример #5
0
 public void SetPropositionTypeBonus( PropositionType type, PropositionClass _class, byte value )
 {
     propTypeBonuses[type, _class] = value;
 }
Пример #6
0
 public void SetPropositionTypeBonus(PropositionType type, PropositionClass _class, byte value)
 {
     propTypeBonuses[type, _class] = value;
 }