Exemplo n.º 1
0
        public void TestGrindStoneCreation()
        {
            GrindStone grindStone = new GrindStone("Violent", "%ATK", "5", "10");

            Assert.AreEqual(RUNESET.VIOLENT, grindStone.Set);
            Assert.AreEqual(RARITY.LEGENDARY, grindStone.Rarity);
        }
Exemplo n.º 2
0
        public static Reward GetReward(RunResult runResult)
        {
            Reward reward = null;

            REWARDTYPE type = GetRewardType(runResult.Drop);

            switch (type)
            {
            case REWARDTYPE.RUNE:
                reward = new Rune.RuneBuilder().Grade(runResult.Grade).Set(runResult.Set).Slot(runResult.Slot).
                         Rarity(runResult.Rarity).MainStat(runResult.MainStat).PrefixStat(runResult.PrefixStat).
                         SubStat1(runResult.SubStat1).SubStat2(runResult.SubStat2).SubStat3(runResult.SubStat3).
                         SubStat4(runResult.SubStat4).Build();
                break;

            case REWARDTYPE.GRINDSTONE:
                reward = new GrindStone(runResult.Set, runResult.MainStat, runResult.SubStat1, runResult.SubStat2);
                break;

            case REWARDTYPE.ENCHANTEDGEM:
                reward = new EnchantedGem(runResult.Set, runResult.MainStat, runResult.SubStat1, runResult.SubStat2);
                break;

            default:
                //throw new NotImplementedException();
                reward = new Reward(runResult.Drop, type);
                break;
            }

            return(reward);
        }
Exemplo n.º 3
0
        public void TestGetOther()
        {
            GrindStone heroDespairHPGrindStone = new GrindStone(RUNESET.DESPAIR, "HP%", RARITY.HERO);

            Assert.IsTrue(riftFilter.ShouldGet(heroDespairHPGrindStone));

            GrindStone legendaryEnergyDEFFlatGrindStone = new GrindStone(RUNESET.ENERGY, "DEF flat", RARITY.LEGENDARY);

            Assert.IsTrue(riftFilter.ShouldGet(legendaryEnergyDEFFlatGrindStone));
        }
Exemplo n.º 4
0
        public void TestViolentGrindStoneFilter()
        {
            // Accept HP%
            GrindStone rareHPGrindStone      = new GrindStone(RUNESET.VIOLENT, "HP%", RARITY.RARE);
            GrindStone magicHPGrindStone     = new GrindStone(RUNESET.VIOLENT, "HP%", RARITY.MAGIC);
            GrindStone heroHPGrindStone      = new GrindStone(RUNESET.VIOLENT, "HP%", RARITY.HERO);
            GrindStone legendaryHPGrindStone = new GrindStone(RUNESET.VIOLENT, "HP%", RARITY.LEGENDARY);

            Assert.IsTrue(riftFilter.ShouldGet(magicHPGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(rareHPGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(heroHPGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(legendaryHPGrindStone));

            // Accept DEF%
            GrindStone rareDEFGrindStone      = new GrindStone(RUNESET.VIOLENT, "DEF%", RARITY.RARE);
            GrindStone magicDEFGrindStone     = new GrindStone(RUNESET.VIOLENT, "DEF%", RARITY.MAGIC);
            GrindStone heroDEFGrindStone      = new GrindStone(RUNESET.VIOLENT, "DEF%", RARITY.HERO);
            GrindStone legendaryDEFGrindStone = new GrindStone(RUNESET.VIOLENT, "DEF%", RARITY.LEGENDARY);

            Assert.IsTrue(riftFilter.ShouldGet(rareDEFGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(magicDEFGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(heroDEFGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(legendaryDEFGrindStone));

            // Accept SPD
            GrindStone rareSPDGrindStone      = new GrindStone(RUNESET.VIOLENT, "SPD", RARITY.RARE);
            GrindStone magicSPDGrindStone     = new GrindStone(RUNESET.VIOLENT, "SPD", RARITY.MAGIC);
            GrindStone heroSPDGrindStone      = new GrindStone(RUNESET.VIOLENT, "SPD", RARITY.HERO);
            GrindStone legendarySPDGrindStone = new GrindStone(RUNESET.VIOLENT, "SPD", RARITY.LEGENDARY);

            Assert.IsTrue(riftFilter.ShouldGet(rareSPDGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(magicSPDGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(heroSPDGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(legendarySPDGrindStone));

            // Accept other hero/legendary grindstone
            GrindStone heroFlatHPGrindStone      = new GrindStone(RUNESET.VIOLENT, "HP flat", RARITY.HERO);
            GrindStone legendaryFlatHPGrindStone = new GrindStone(RUNESET.VIOLENT, "DEF flat", RARITY.LEGENDARY);

            Assert.IsTrue(riftFilter.ShouldGet(heroFlatHPGrindStone));
            Assert.IsTrue(riftFilter.ShouldGet(legendaryFlatHPGrindStone));

            GrindStone magicFlatHPGrindStone = new GrindStone(RUNESET.VIOLENT, "HP flat", RARITY.MAGIC);

            Assert.IsFalse(riftFilter.ShouldGet(magicFlatHPGrindStone));
        }
Exemplo n.º 5
0
        private void BtnAddGemStoneFilter_Click(object sender, RoutedEventArgs e)
        {
            REWARDTYPE type     = (REWARDTYPE)cbType.SelectedItem;
            RUNESET    set      = (RUNESET)cbSet.SelectedItem;
            string     mainStat = (string)cbMainStat.SelectedItem;
            RARITY     rarity   = (RARITY)cbRarity.SelectedItem;

            List <GemStone> list = (List <GemStone>)lvGemStoneList.ItemsSource;

            if (type == REWARDTYPE.GRINDSTONE)
            {
                GrindStone grindStone = new GrindStone(set, mainStat, rarity);
                list.Add(grindStone);
            }
            else
            {
                EnchantedGem enchantedGem = new EnchantedGem(set, mainStat, rarity);
                list.Add(enchantedGem);
            }

            lvGemStoneList.ItemsSource = null;
            lvGemStoneList.ItemsSource = list;
        }
Exemplo n.º 6
0
 private bool IsHeroOrLegendGrindStone(GrindStone grindStone)
 {
     return(grindStone.Rarity == Rune.RARITY.HERO || grindStone.Rarity == Rune.RARITY.LEGENDARY);
 }
Exemplo n.º 7
0
 private bool IsFlatGrindstone(GrindStone grindStone)
 {
     return(!grindStone.MainStat.Contains("%") && !grindStone.MainStat.ToLower().Contains("spd"));
 }
Exemplo n.º 8
0
 private bool ShouldGetGrindStone(GrindStone grindStone)
 {
     // TODO
     return(true);
 }