/*
         * Add explicits until the item has an amount equal to the selected count
         */
        public static void AddExplicits(IRandom random, Equipment item, AffixManager affixManager, Dictionary <int, int> affixCountOdds, CurrencyModifiers currencyModifiers)
        {
            var sum  = affixCountOdds.Sum(x => x.Value);
            var roll = random.Next(sum);

            var affixCount = 0;
            int count      = 0;

            foreach (var weight in affixCountOdds)
            {
                count += weight.Value;

                if (roll < count)
                {
                    affixCount = weight.Key;
                    break;
                }
            }

            while (item.Stats.Count < affixCount)
            {
                bool successful = StatFactory.AddExplicit(random, item, affixManager, currencyModifiers);

                if (!successful)
                {
                    break;
                }
            }
        }
        public static bool AddExplicit(IRandom random, Equipment item, AffixManager affixManager, CurrencyModifiers currencyModifiers)
        {
            var equipmentModifiers = new EquipmentModifiers(item);
            var affix = affixManager.GetAffix(equipmentModifiers, currencyModifiers, item.Stats.Select(x => x.Affix).ToList(), item.Rarity, random);

            if (affix == null)
            {
                return(false);
            }

            var stat = AffixToStat(random, item, affix);

            item.Stats.Add(stat);

            return(true);
        }