Beispiel #1
0
        public void ShowInventory()
        {
            NameItemList.Clear();
            Console.WriteLine("");
            Console.WriteLine("Here's all the stuff I have for sale.");

            Console.WriteLine("");
            Console.WriteLine("Weapons List");
            var countWeapon = 1;

            foreach (var W in this.Weapons.OrderBy(x => x.Name))
            {
                Console.WriteLine($"W{countWeapon}: {W.Name} have {W.Strength} Strength sell for {W.OriginalValue} gold");
                NameItemList.Add($"W{countWeapon}", W);
                countWeapon++;
            }

            Console.WriteLine("");
            Console.WriteLine("Armors List");
            var countArmor = 1;

            foreach (var A in this.Armors.OrderBy(x => x.Name))
            {
                Console.WriteLine($"A{countArmor}: {A.Name} have {A.Defense} Defense sell for {A.OriginalValue} gold");
                NameItemList.Add($"A{countArmor}", A);
                countArmor++;
            }

            Console.WriteLine("");
            Console.WriteLine("Potions List");
            var countPotion = 1;

            foreach (var P in Potions.OrderBy(x => x.Name))
            {
                Console.WriteLine($"P{countPotion}: {P.Name} contain {P.HP} hp for {P.OriginalValue} gold");
                NameItemList.Add($"P{countPotion}", P);
                countPotion++;
            }
            Console.WriteLine("");
            BuyItem();
        }