Example #1
0
        private Possesion PossesionCheck(Consumable consumable)
        {
            var possesion = new Possesion(0, null);//TODO

            foreach (var consInInv in Inventory)
            {
                if (consInInv.Item.Id == consumable.Id)
                {
                    possesion = consInInv;
                    break;
                }
            }
            return(possesion);
        }
Example #2
0
        public Badge Lose()//Before GiveBadge now also switches defeated to true.
        {
            Defeated = true;
            Possesion ToBeRemoved = null;

            foreach (Possesion i in Inventory)
            {
                if (i.Item is Badge)
                {
                    ToBeRemoved = i; break;
                }
            }
            if (ToBeRemoved != null)
            {
                Inventory.Remove(ToBeRemoved);
                return(ToBeRemoved.Item as Badge);
            }
            else
            {
                throw new GymLeaderHasNoBadgeException();
            }
        }