Exemple #1
0
        private void __AddCardsButton_Click(object sender, EventArgs e)
        {
            // Convert the set to a pool of skills:
            List <Skill>    pool = new List <Skill>();
            SkillBoosterSet set  = SkillBoosterSet.Sets[__SelectedSet.SelectedIndex < 0 ? 0 : __SelectedSet.SelectedIndex];

            foreach (int i in set.SetSkills)
            {
                pool.Add(SkillDatabase.Data[i]);
            }

            // Pool is now added to a grab bag:
            GrabBag bag = new GrabBag(pool);

            // Now I need to grab some number of skills and add 'em to the league!
            BoosterLeaguePool newBooster = new BoosterLeaguePool();

            foreach (Skill skill in bag.PullXFromBag((int)__NumberOfBoostersToAdd.Value))
            {
                League.AddSkill(skill);
                newBooster.AddSkill(skill);
            }

            // And redraw the league pool:
            __LeaguePoolDisplay.Redraw();

            // Let's show the player what they got!
            NewBoostersForLeagueDialog.ShowAddedBoostersDialog(1, newBooster);
        }
Exemple #2
0
        private void __Button_AddBoosters_Click(object sender, EventArgs e)
        {
            // Add boosters to league:
            List <SkillBoosterPack> boosters = SkillBoosterPack.GenerateBoosterBox(__SelectedSet.SelectedIndex < 0 ? 0 : __SelectedSet.SelectedIndex, (int)__NumberOfBoostersToAdd.Value);
            // Temporary league to hold the added skills for display purposes...
            BoosterLeaguePool newBoosters = new BoosterLeaguePool();

            newBoosters.AddBox(boosters);
            newBoosters.SortByProfessionAttribute();
            newBoosters.SortByRarity();
            League.AddBox(boosters);
            // Redraw the pool...
            __LeaguePoolDisplay.Redraw();
            // Show a dialog containing the new skills:
            NewBoostersForLeagueDialog.ShowAddedBoostersDialog((int)__NumberOfBoostersToAdd.Value, newBoosters);
        }