Ejemplo n.º 1
0
 public Archer()
 {
     Name            = "Лучник №1";
     Hp              = 80;
     AbstractFactory = ArcherFactory.Create();
     Weapon          = AbstractFactory.CreateWeapon("PlasticBow");
     Armor           = AbstractFactory.CreateArmor("WoodenChainMail");
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            ICharacterFactory factory;

            Character character;

            //// Create archer
            factory   = new ArcherFactory();
            character = factory.Create();

            //// Create warrior
            factory   = new WarriorFactory();
            character = factory.Create();

            //// Create wizard
            factory   = new WizardFactory();
            character = factory.Create();
        }