-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (30 loc) · 1.14 KB
/
Program.cs
File metadata and controls
35 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using AbstractFactory.Elf;
using AbstractFactory.Human;
using AbstractFactory.Orc;
using AbstractFactory.Undead;
using System;
namespace AbstractFactory
{
internal class Program
{
static void Main(string[] args)
{
Hero human = new Hero(new HumanEquipmentFactory());
Hero elf = new Hero(new ElfEquipmentFactory());
Hero orc = new Hero(new OrcEquipmentFactory());
Hero undead = new Hero(new UndeadEquipmentFactory());
Console.WriteLine("=== Герой фракции Люди ===");
human.ShowEquipment();
human.UseConsumable();
Console.WriteLine("\n=== Герой фракции Эльфы ===");
elf.ShowEquipment();
elf.UseConsumable();
Console.WriteLine("\n=== Герой фракции Орки ===");
orc.ShowEquipment();
orc.UseConsumable();
Console.WriteLine("\n=== Бонус-задание: Герой фракции Нежить ===");
undead.ShowEquipment();
undead.UseConsumable();
}
}
}