public void UseSpellSlot(Magic.Level _level) { if (HaveSpellSlot(_level)) { SpellsLeft[_level]--; } }
public bool HaveSpellSlot(Magic.Level _level) { // return true if the spellcaster has a spell slot of the specified level or higher foreach (KeyValuePair <Magic.Level, int> level_spells in SpellsLeft.Where(sl => (int)sl.Key >= (int)_level)) { if (level_spells.Value > 0) { return(true); } } return(false); }