Ejemplo n.º 1
0
        private static void TestArmorFactory(IArmorFactory factory)
        {
            IArmor heavyArmor  = factory.Create(ArmorType.Heavy);
            IArmor lightArmor  = factory.Create(ArmorType.Light);
            IArmor mediumArmor = factory.Create(ArmorType.Medium);

            Console.WriteLine($"Heavy weapon: {heavyArmor}");
            Console.WriteLine($"Light weapon: {lightArmor}");
            Console.WriteLine($"Medium weapon: {mediumArmor}");
        }
Ejemplo n.º 2
0
 protected TankFactory(ITankComponentFactory componentFactory)
 {
     _componentFactory = componentFactory;
     _armorFactory = componentFactory.CreateArmorFactory();
 }