public bool HasItemWithType(Spell.Types type) { if (Items != null) { for (int i = 0; i < MAXNUMBER_ITEMS; i++) { if (Items[i] != null && Items[i].MagicSpell != null && Items[i].MagicSpell.Type == type) { return(true); } } } return(false); }
public bool CanCastSpellWithType(Spell.Types type) { if (MagicSpells != null) { for (int i = 0; i < MAXNUMBER_SPELLS; i++) { if (MagicSpells[i] != null && MagicSpells[i].Type == type && MagicSpells[i].MagicPoints[0] <= MagicPoints) { return(true); } } } return(false); }