Пример #1
0
        static void Main(string[] args)
        {
            EnemyTank  tank  = new EnemyTank();
            EnemyRobot robot = new EnemyRobot();

            IEnemyAttack robotAdapter = new EnemyRobotAdapter(robot);

            Console.WriteLine("======== ROBO ========");
            robot.React("FS34");
            robot.MoveForward();
            robot.Smash();

            Console.WriteLine("======== TANK ========");
            tank.Drive("FS34");
            tank.Move();
            tank.FireGun();

            Console.WriteLine("======== ROBOT ADPTER ========");
            robotAdapter.Drive("C3PO");
            robotAdapter.Move();
            robotAdapter.FireGun();

            Console.ReadKey();
        }
Пример #2
0
 public void FireGun()
 {
     _enemyRobot.Smash();
 }