示例#1
0
 private void bSave_Click(object sender, EventArgs e)
 {
     SpellPriority.Clear();
     MirrowList.Items.Clear();
     foreach (Object o in lsSpellPriority.Items)
     {
         SpellPriority.Add(o.ToString());
         MirrowList.Items.Add(o);
     }
 }
示例#2
0
 private void bSave_Click(object sender, EventArgs e)
 {
     SpellPriority.Clear();
     MirrowList.Items.Clear();
     foreach (Object o in lsSpellPriority.Items)
     {
         SpellPriority.Add(o.ToString());
         MirrowList.Items.Add(o);
     }
     character.OnCalculationsInvalidated();
     Hide();
 }
        public CharacterCalculationsWarlock(Character character, Stats stats) : this()
        {
            Character  = character;
            TotalStats = stats;

            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = new CalculationOptionsWarlock();
            }

            Options = (CalculationOptionsWarlock)Character.CalculationOptions;
            if (Options.SpellPriority.Count > 0)
            {
                _warlockAbilities.Clear();

                foreach (String name in Options.SpellPriority)
                {
                    Abilities += "\r\n- " + name;

                    Spell spell = SpellFactory.CreateSpell(name, stats, character, Options);
                    if (spell == null)
                    {
                        continue;                   //i.e. skip over the following lines if null
                    }
                    SpellPriority.Add(spell);       //used by "DPS Sources" comparison calcs
                    _warlockAbilities.Enqueue(spell);

                    //wire up the event handlers
                    #region backdraft notifications
                    if (character.WarlockTalents.Backdraft > 0)
                    {
                        if (spell.SpellTree == SpellTree.Destruction)
                        {
                            Backdraft.AuraUpdate += spell.BackdraftAuraHandler;
                            spell.SpellCast      += Backdraft.SpellCastHandler;
                        }
                    }
                    #endregion
                }
            }
        }