123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- using System;
- using System.Collections.Generic;
- class Player
- {
- public string Name { get; set; }
- public string Hero { get; set; }
- public Player(string name)
- {
- Name = name;
- }
- public void Display()
- {
- Console.WriteLine($"{Name}");
- }
- public void PickHero(string hero)
- {
- Hero = hero;
- Console.WriteLine($"{Name} выбрал героя: {Hero}");
- }
- public void PickItems(List<Item> items)
- {
- Console.WriteLine($"{Name} пикает предметы:");
- foreach (var item in items)
- {
- Console.WriteLine($"- {item.ItemName}");
- }
- }
- public void BuyItem(Item item)
- {
- Console.WriteLine($"{Name} купил предмет: {item.ItemName}");
- }
- }
- class Item
- {
- public string ItemName { get; set; }
- public Item(string itemName)
- {
- ItemName = itemName;
- }
- public void Display()
- {
- Console.WriteLine($"{ItemName}");
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Player player1 = new Player("h1mera");
- // Выбираем героя
- player1.PickHero("Invoker");
- // Список предметов
- List<Item> itemsToPick = new List<Item>
- {
- new Item("Desolator"),
- new Item("Daedalus"),
- new Item("Butterfly"),
- new Item("Silver Edge"),
- new Item("Power Treads"),
- new Item("Satanic"),
- new Item("Refresher Orb"),
- new Item("Scythe of Wyse"),
- new Item("Travel Boots"),
- new Item("Octarine Core"),
- new Item("Blink Dagger"),
- new Item("Bloodthorn"),
- new Item("Aghanim Scepter"),
- new Item("Bloodstone"),
- new Item("Abbysal Blade"),
- new Item("Heart of Tarrasque"),
- new Item("Phase Boots"),
- new Item("Eternal Shroud"),
- new Item("Boots of Bearing"),
- new Item("Arcane Blink"),
- new Item("Aghanim Bleesing"),
- new Item("Glimmer Cape"),
- new Item("Divine Rapier"),
- new Item("Wind Waker"),
- };
- // Покупаем предмет
- Item itemToBuy1 = new Item("Refresher Orb");
- Item itemToBuy2 = new Item("Scythe of Wyse");
- Item itemToBuy3 = new Item("Travel Boots");
- Item itemToBuy4 = new Item("Blink Dagger");
- Item itemToBuy5 = new Item("Octarine Core");
- Item itemToBuy6 = new Item("Bloodthorn");
- player1.BuyItem(itemToBuy1);
- player1.BuyItem(itemToBuy2);
- player1.BuyItem(itemToBuy3);
- player1.BuyItem(itemToBuy4);
- player1.BuyItem(itemToBuy5);
- player1.BuyItem(itemToBuy6);
- }
- }
|