Esempio n. 1
0
        internal bool Remove(string item)
        {
            if (!HasItem(item))
            {
                return(false);
            }
            var it = Inv.Where(i => i.Name.Equals(item, StringComparison.InvariantCultureIgnoreCase)).Last();

            if (WarriorGear.Any(i => i.Name.Equals(it.Name, StringComparison.CurrentCultureIgnoreCase)) ||
                MageGear.Any(i => i.Name.Equals(it.Name, StringComparison.CurrentCultureIgnoreCase)))
            {
                if (Inv.Where(i => string.Equals(i.Name, it.Name, StringComparison.InvariantCultureIgnoreCase)).Count() == 1)
                {
                    return(false);
                }
            }

            Inv.Remove(it);
            UserAccounts.SaveAccounts();
            return(true);
        }