Пример #1
0
        public void Constructor1()
        {
            var item = new StatsItem(null, null, new List<Item>());

            item.Update();

            Assert.IsNotNull(item.MainHand);
            Assert.IsFalse(item.IsAmbidexterity());
            Assert.AreEqual(1, item.GetWeaponAttackPerSecond().Min);
        }
Пример #2
0
        public void Constructor1()
        {
            var item = new StatsItem(null, null, new List <Item>());

            item.Update();

            Assert.IsNotNull(item.MainHand);
            Assert.IsFalse(item.IsAmbidexterity());
            Assert.AreEqual(1, item.GetWeaponAttackPerSecond().Min);
        }
Пример #3
0
        public void Constructor2()
        {
            var mainHand = new Item(new ItemAttributes { attacksPerSecondItem = new ItemValueRange(1.4) });
            var item = new StatsItem(mainHand, null, new List<Item>());

            item.Update();

            Assert.AreEqual(mainHand, item.MainHand);
            Assert.IsFalse(item.IsAmbidexterity());
            Assert.AreEqual(1.4, item.GetWeaponAttackPerSecond().Min);
        }
Пример #4
0
        public void Constructor3()
        {
            var mainHand = new Item(new ItemAttributes { attacksPerSecondItem = new ItemValueRange(1.4) });
            var offHand = new Item(new ItemAttributes { attacksPerSecondItem = new ItemValueRange(1.2) });
            var item = new StatsItem(mainHand, offHand, new List<Item>());

            item.Update();

            Assert.AreEqual(mainHand, item.MainHand);
            Assert.IsTrue(item.IsAmbidexterity());
            Assert.AreEqual(1.15 * 2 * 1 / (1 / 1.4 + 1 / 1.2), item.GetWeaponAttackPerSecond().Min);
        }
Пример #5
0
        public D3Calculator(Hero hero, Item mainHand, Item offHand, IEnumerable <Item> items)
        {
            HeroClass = hero.HeroClass;
            HeroLevel = hero.Level;

            // Build unique item equivalent to items worn
            HeroStatsItem = new StatsItem(mainHand, offHand, items);

            levelAttributes        = new ItemAttributesFromLevel(hero);
            paragonLevelAttributes = new ItemAttributesFromParagonLevel(hero);

            Update();
        }
Пример #6
0
        public D3Calculator(Hero hero, Item mainHand, Item offHand, IEnumerable<Item> items)
        {
            HeroClass = hero.heroClass;
            HeroLevel = hero.level;

            // Build unique item equivalent to items worn
            HeroStatsItem = new StatsItem(mainHand, offHand, items);

            levelAttributes = new ItemAttributesFromLevel(hero);
            paragonLevelAttributes = new ItemAttributesFromParagonLevel(hero);

            Update();
        }
Пример #7
0
        public void Constructor2()
        {
            var mainHand = new Item(new ItemAttributes {
                attacksPerSecondItem = new ItemValueRange(1.4)
            });
            var item = new StatsItem(mainHand, null, new List <Item>());

            item.Update();

            Assert.AreEqual(mainHand, item.MainHand);
            Assert.IsFalse(item.IsAmbidexterity());
            Assert.AreEqual(1.4, item.GetWeaponAttackPerSecond().Min);
        }
Пример #8
0
        public void Constructor3()
        {
            var mainHand = new Item(new ItemAttributes {
                attacksPerSecondItem = new ItemValueRange(1.4)
            });
            var offHand = new Item(new ItemAttributes {
                attacksPerSecondItem = new ItemValueRange(1.2)
            });
            var item = new StatsItem(mainHand, offHand, new List <Item>());

            item.Update();

            Assert.AreEqual(mainHand, item.MainHand);
            Assert.IsTrue(item.IsAmbidexterity());
            Assert.AreEqual(1.15 * 2 * 1 / (1 / 1.4 + 1 / 1.2), item.GetWeaponAttackPerSecond().Min);
        }
Пример #9
0
        public D3Calculator(Follower follower, HeroClass heroClass, Item mainHand, Item offHand, IEnumerable <Item> items)
        {
            HeroClass = heroClass;
            HeroLevel = follower.Level;

            foreach (var item in items.Union(new[] { mainHand, offHand }))
            {
                ApplyFollowersBonusMalusOnItemAttributes(item.AttributesRaw);
                if (item.Gems != null)
                {
                    foreach (var gem in item.Gems)
                    {
                        ApplyFollowersBonusMalusOnItemAttributes(gem.AttributesRaw);
                    }
                }
            }

            // Build unique item equivalent to items worn
            HeroStatsItem = new StatsItem(mainHand, offHand, items);

            levelAttributes = new Followers.ItemAttributesFromLevel(follower, heroClass);

            Update();
        }
Пример #10
0
        public D3Calculator(Follower follower, HeroClass heroClass, Item mainHand, Item offHand, IEnumerable<Item> items)
        {
            HeroClass = heroClass;
            HeroLevel = follower.level;

            foreach (var item in items.Union(new[] { mainHand, offHand }))
            {
                ApplyFollowersBonusMalusOnItemAttributes(item.AttributesRaw, heroClass);
                if (item.Gems != null)
                {
                    foreach (var gem in item.Gems)
                    {
                        ApplyFollowersBonusMalusOnItemAttributes(gem.AttributesRaw, heroClass);
                    }
                }
            }

            // Build unique item equivalent to items worn
            HeroStatsItem = new StatsItem(mainHand, offHand, items);

            levelAttributes = new Followers.ItemAttributesFromLevel(follower, heroClass);

            Update();
        }
Пример #11
0
        private void buildUniqueItemFollowerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var follower = (Follower)guiD3ProfileTreeView.SelectedNode.Tag;

            var followerItems = new[]
            {
                follower.Items.Special,
                follower.Items.LeftFinger,
                follower.Items.Neck,
                follower.Items.RightFinger
            };

            var items = followerItems
                .Where(fi => fi != null)
                .Select(fi => Item.CreateFromTooltipParams(fi.TooltipParams))
                .ToList();

            var mainHand = Item.CreateFromTooltipParams(follower.Items.MainHand.TooltipParams);

            var offHand = follower.Items.OffHand != null ? Item.CreateFromTooltipParams(follower.Items.OffHand.TooltipParams) : new Item(new ItemAttributes());

            var heroStuff = new StatsItem(mainHand, offHand, items.ToArray());
            heroStuff.Update();

            var node = new TreeNode($"Unique Item for {follower.Slug} follower");
            node.Nodes.AddRange(CreateNodeFromD3Object(heroStuff).ToArray());

            guiD3ProfileTreeView.Nodes.Add(node);
        }
Пример #12
0
        private void buildUniqueItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var heroInformation = (BNetContext<Hero>)guiD3ProfileTreeView.SelectedNode.Tag;
            var hero = heroInformation.Data;

            var heroItems = new[]
            {
                hero.Items.Bracers,
                hero.Items.Feet,
                hero.Items.Hands,
                hero.Items.Head,
                hero.Items.LeftFinger,
                hero.Items.Legs,
                hero.Items.Neck,
                hero.Items.RightFinger,
                hero.Items.Shoulders,
                hero.Items.Torso,
                hero.Items.Waist
            };

            var items = heroItems
                .Where(hi => hi != null)
                .Select(hi => Item.CreateFromTooltipParams(hi.TooltipParams))
                .ToList();

            var mainHand = Item.CreateFromTooltipParams(hero.Items.MainHand.TooltipParams);

            Item offHand;
            if (hero.Items.OffHand != null)
            {
                offHand = Item.CreateFromTooltipParams(hero.Items.OffHand.TooltipParams);
            }
            else
            {
                offHand = new Item { AttributesRaw = new ItemAttributes() };
            }

            var heroStuff = new StatsItem(mainHand, offHand, items.ToArray());
            heroStuff.Update();

            var node = new TreeNode($"Unique Item for {hero.Name}");
            node.Nodes.AddRange(CreateNodeFromD3Object(heroStuff).ToArray());

            guiD3ProfileTreeView.Nodes.Add(node);
        }