private void AbstractFactoryStart(object sender, RoutedEventArgs e) { AbstractFactory.Hero elf = new AbstractFactory.Hero(new ElfFactory()); MessageBox.Show(elf.Hit()); MessageBox.Show(elf.Run()); AbstractFactory.Hero voin = new AbstractFactory.Hero(new VoinFactory()); MessageBox.Show(voin.Hit()); MessageBox.Show(voin.Run()); }
static void Main(string[] args) { Hero elf = new Hero(new ElfFactory()); elf.Hit(); elf.Run(); Hero voin = new Hero(new VoinFactory()); voin.Hit(); voin.Run(); }
static void Main(string[] args) { HeroFactory voin = new VoinFactory(); voin = new ElfFactory(); Hero heroVoin = new Hero(voin); heroVoin.Hit(); heroVoin.Run(); Console.ReadLine(); }
static void Main(string[] args) { Hero elf = new Hero(new ElfFactory()); Hero hero = new Hero(new VoinFactory()); elf.Hit(); elf.Run(); Console.WriteLine("------------------"); hero.Hit(); hero.Run(); Console.ReadKey(); }
static void Main(string[] args) { Hero archer = new Hero(new ElfCreator()); archer.Hit(); archer.Run(); Hero warrior = new Hero(new HumanCreator()); warrior.Hit(); warrior.Run(); Console.ReadLine(); }
static void Main(string[] args) { Hero elf = new Hero(new ElfFactory()); elf.Hit(); elf.Run(); Hero warrior = new Hero(new WarriorFactory()); warrior.Hit(); warrior.Run(); Console.ReadLine(); }
static void Main(string[] args) { Hero elf = new Hero(new ElfFactory()); elf.Hit(); elf.Run(); Hero voin = new Hero(new VoinFactory()); voin.Hit(); voin.Run(); Console.ReadLine(); Console.WriteLine("Hello World!"); }
static void Main(string[] args) { HeroFactory orkFactory = new OrkFactory(); Hero ork = new Hero(orkFactory); ork.Hit(); ork.Run(); HeroFactory voinFactory = new VoinFactory(); Hero voin = new Hero(voinFactory); voin.Hit(); voin.Run(); Console.ReadLine(); }