Inheritance: EnemyShipBuilding
 void OnEnable()
 {
     Debug.Log ("------------------");
     Debug.Log ("ABSTRACT FACTORY DESIGN PATTERN");
     // Test here:
     EnemyShipBuilding ufoBuilder = new UFOEnemyShipBuilding();
     ufoBuilder.orderShip(ShipType.UFO);
 }
        void OnEnable()
        {
            Debug.Log("------------------");
            Debug.Log("ABSTRACT FACTORY DESIGN PATTERN");
            // Test here:
            EnemyShipBuilding ufoBuilder = new UFOEnemyShipBuilding();

            ufoBuilder.orderShip(ShipType.UFO);
        }
Exemplo n.º 3
0
        private static void Main(string[] args)
        {
            EnemyShipBuilding <ShipType> MakeUfos = new UFOEnemyShipBuilding();

            EnemyShip theGrunt = MakeUfos.orderTheShip(ShipType.Ufo);

            Console.WriteLine(theGrunt.Name);

            EnemyShip theBoss = MakeUfos.orderTheShip(ShipType.UfoBoss);

            Console.WriteLine(theBoss.Name);
        }
Exemplo n.º 4
0
        static void Main()
        {
            // EnemyShipBuilding handles orders for new EnemyShips
            // You send it a code using the orderTheShip method &
            // it sends the order to the right factory for creation

            EnemyShipBuilding MakeUFOs = new UFOEnemyShipBuilding();

            EnemyShip theGrunt = MakeUFOs.orderTheShip("UFO");

            Console.WriteLine(theGrunt + "\n");

            EnemyShip theBoss = MakeUFOs.orderTheShip("UFO BOSS");

            Console.WriteLine(theBoss + "\n");

            Console.ReadLine();
        }