Example #1
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);
        }
Example #2
0
        public void GetRune_GivenInvalidRuneSet_ReturnUnknownRune()
        {
            Rune rune = new Rune.RuneBuilder().Set("Some invalid set").Rarity("blah").Build();

            Assert.AreEqual(rune.Type, REWARDTYPE.RUNE);
            Assert.AreEqual(rune.Set, RUNESET.UNKNOWN);
            Assert.AreEqual(rune.Rarity, RARITY.UNKNOWN);
        }
Example #3
0
        public void GetRune_GivenRuneInfo_ReturnRune()
        {
            Rune rune = new Rune.RuneBuilder().Set("Violent").Rarity("Hero").Build();

            Assert.AreEqual(rune.Type, REWARDTYPE.RUNE);
            Assert.AreEqual(rune.Set, RUNESET.VIOLENT);
            Assert.AreEqual(rune.Rarity, RARITY.HERO);
        }
Example #4
0
        private void btnTestLog_Click(object sender, RoutedEventArgs e)
        {
            // Rune
            Rune rune1 = new Rune.RuneBuilder().Grade("6*").Set("Blade").Slot("4").
                         Rarity("Legendary").MainStat("ATK%").PrefixStat("DEF +5").
                         SubStat1("HP% +5").SubStat2("SPD +4").SubStat3("HP +200").
                         SubStat4("CRATE +6").Build();

            Logger.Log(ACTION.GET, rune1);
            Thread.Sleep(1000);
            Rune rune2 = new Rune.RuneBuilder().Grade("4*").Set("Violent").Slot("4").
                         Rarity("Magic").MainStat("ATK%").PrefixStat("DEF +5").
                         SubStat1("HP% +5").SubStat2("SPD +4").SubStat3("HP +200").
                         SubStat4("CRATE +6").Build();

            Logger.Log(ACTION.SELL, rune2);

            // Other
            Reward reward1 = new Reward("Item 1", REWARDTYPE.SUMMONSTONE);
            Reward reward2 = new Reward("Item 2", REWARDTYPE.GRINDSTONE);

            Logger.Log(ACTION.GET, reward1);
            Logger.Log(ACTION.SELL, reward2);

            // General
            Logger.Log("General log 1");
            Logger.Log("General log 2");
            Logger.Log("General log 3");

            while (Logger.Message.Count > 0)
            {
                UIElement logComponent = LogFactory.Build(Logger.Message.Dequeue());
                SetLogVisibility(logComponent);
                logPanel.Children.Insert(0, logComponent);
            }
        }