示例#1
0
        private RecipeResult getNextResult(Dictionary <string, List <Gear> > buckets)
        {
            RecipeResult result = new RecipeResult();

            result.Instance = this;

            MatchedSet set = new MatchedSet();

            set.Amulet    = pullValue(buckets, GearType.Amulet.ToString());
            set.Armour    = pullValue(buckets, GearType.Chest.ToString());
            set.Belt      = pullValue(buckets, GearType.Belt.ToString());
            set.Boots     = pullValue(buckets, GearType.Boots.ToString());
            set.Gloves    = pullValue(buckets, GearType.Gloves.ToString());
            set.Helm      = pullValue(buckets, GearType.Helmet.ToString());
            set.RingLeft  = pullValue(buckets, GearType.Ring.ToString());
            set.RingRight = pullValue(buckets, GearType.Ring.ToString());

            // Use two one-handed items or one two-handed item, based on which has the lowest item level.
            int oneHandedItemLevel = buckets.ContainsKey("One Handed") && buckets["One Handed"].Count > 1 ?
                                     buckets["One Handed"][0].ItemLevel : int.MaxValue;
            int twoHandedItemLevel = buckets.ContainsKey("Two Handed") && buckets["Two Handed"].Count > 0 ?
                                     buckets["Two Handed"][0].ItemLevel : int.MaxValue;

            if (oneHandedItemLevel <= twoHandedItemLevel)
            {
                // Includes the case where buckets["Two Handed"] is empty and buckets["One Handed"] has one item.
                set.Weapon  = pullValue(buckets, "One Handed");
                set.Offhand = pullValue(buckets, "One Handed");
            }
            else
            {
                set.Weapon  = pullValue(buckets, "Two Handed");
                set.Offhand = set.Weapon;
            }

            result.PercentMatch = set.Match();
            result.IsMatch      = result.PercentMatch > base.ReturnMatchesGreaterThan;
            result.MatchedItems = set.GetAll().Cast <Item>().ToList();
            result.Missing      = set.GetMissing();

            return(result);
        }
示例#2
0
        private RecipeResult getNextResult(Dictionary <string, List <Gear> > buckets)
        {
            RecipeResult result = new RecipeResult();

            result.Instance = this;

            MatchedSet set = new MatchedSet();

            set.Amulet    = pullValue(buckets, GearType.Amulet.ToString());
            set.Armour    = pullValue(buckets, GearType.Chest.ToString());
            set.Belt      = pullValue(buckets, GearType.Belt.ToString());
            set.Boots     = pullValue(buckets, GearType.Boots.ToString());
            set.Gloves    = pullValue(buckets, GearType.Gloves.ToString());
            set.Helm      = pullValue(buckets, GearType.Helmet.ToString());
            set.RingLeft  = pullValue(buckets, GearType.Ring.ToString());
            set.RingRight = pullValue(buckets, GearType.Ring.ToString());

            if (buckets["One Handed"].Count > 0 && buckets.ContainsKey(GearType.Shield.ToString()) && buckets[GearType.Shield.ToString()].Count > 0)
            {
                set.Weapon  = pullValue(buckets, "One Handed");
                set.Offhand = pullValue(buckets, GearType.Shield.ToString());
            }
            else if (buckets["One Handed"].Count > 1)
            {
                set.Weapon  = pullValue(buckets, "One Handed");
                set.Offhand = pullValue(buckets, "One Handed");
            }
            else
            {
                set.Weapon  = pullValue(buckets, "Two Handed");
                set.Offhand = set.Weapon;
            }

            result.PercentMatch = set.Match();
            result.IsMatch      = result.PercentMatch > base.ReturnMatchesGreaterThan;
            result.MatchedItems = set.GetAll().Cast <Item>().ToList();
            result.Missing      = set.GetMissing();

            return(result);
        }
示例#3
0
        private RecipeResult getNextResult(Dictionary<string, List<Gear>> buckets)
        {
            RecipeResult result = new RecipeResult();
            result.Instance = this;

            MatchedSet set = new MatchedSet();

            set.Amulet = pullValue(buckets, GearType.Amulet.ToString());
            set.Armour = pullValue(buckets, GearType.Chest.ToString());
            set.Belt = pullValue(buckets, GearType.Belt.ToString());
            set.Boots = pullValue(buckets, GearType.Boots.ToString());
            set.Gloves = pullValue(buckets, GearType.Gloves.ToString());
            set.Helm = pullValue(buckets, GearType.Helmet.ToString());
            set.RingLeft = pullValue(buckets, GearType.Ring.ToString());
            set.RingRight = pullValue(buckets, GearType.Ring.ToString());

            if (buckets["One Handed"].Count > 0 && buckets.ContainsKey(GearType.Shield.ToString()) && buckets[GearType.Shield.ToString()].Count > 0)
            {
                set.Weapon = pullValue(buckets, "One Handed");
                set.Offhand = pullValue(buckets, GearType.Shield.ToString());
            }
            else if (buckets["One Handed"].Count > 1)
            {
                set.Weapon = pullValue(buckets, "One Handed");
                set.Offhand = pullValue(buckets, "One Handed");
            }
            else
            {
                set.Weapon = pullValue(buckets, "Two Handed");
                set.Offhand = set.Weapon;
            }

            result.PercentMatch = set.Match();
            result.IsMatch = result.PercentMatch > base.ReturnMatchesGreaterThan;
            result.MatchedItems = set.GetAll().Cast<Item>().ToList();
            result.Missing = set.GetMissing();

            return result;
        }