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());
        }
示例#2
0
        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();
        }
示例#3
0
        static void Main(string[] args)
        {
            HeroFactory voin = new VoinFactory();

            voin = new ElfFactory();
            Hero heroVoin = new Hero(voin);

            heroVoin.Hit();
            heroVoin.Run();


            Console.ReadLine();
        }
示例#4
0
        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();
        }
示例#5
0
        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();
        }
示例#6
0
        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!");
        }
示例#8
0
        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();
        }