Exemple #1
0
        // Здесь можно купить защитные предметы
        private void ProtectionStore(Player player)
        {
            Console.Clear();
            HelloPlayer(player);
            PrintForShops();
            foreach (var protection in Program.ProtectionThings)
            {
                WriteCharacteristics(protection.GetCharacteristics());
                switch (Console.ReadKey(true).Key)
                {
                case ConsoleKey.Y:
                    if (player.HaveMoney((int)((protection.Cost * RealCosts["armor"]))))
                    {
                        Console.WriteLine("Вы приобрели {0}", protection.Name);
                        player.TryOnProtection(protection);
                        return;
                    }
                    break;

                case ConsoleKey.Escape:
                    return;
                }
                Console.Clear();
            }
        }