Ejemplo n.º 1
0
        internal static void EatCandy(CandyStorage db)
        {
            var candyNames   = db.GetCandyNames();
            var eatCandyMenu = new View()
                               .AddMenuText("Which candy do you want to eat?")
                               .AddMenuOptions(candyNames);

            Console.Write(eatCandyMenu.GetFullMenu());

            var candySelected = Console.ReadKey().KeyChar.ToString();
            var candyIndex    = int.Parse(candySelected);
            var candyToEat    = candyNames[candyIndex - 1];

            db.EatCandy(candyToEat);
        }