Exemplo n.º 1
0
        static void Main()
        {
            EnemyTank     tx3Tank      = new EnemyTank();
            EnemyRobot    amyTheRobot  = new EnemyRobot();
            EnemyAttacker robotAdapter = new EnemyRobotAdapter(amyTheRobot);

            Write("The Robot:");
            amyTheRobot.ReactToHuman("Bishnu");
            amyTheRobot.WalkForward();
            amyTheRobot.SmashWitHands();

            Write("The Enemy Tank");
            tx3Tank.AssignDriver("Bishnu");
            tx3Tank.DriveForward();
            tx3Tank.FireWeapon();

            Write("The Robot with Adapter");
            robotAdapter.AssignDriver("Samir");
            robotAdapter.DriveForward();
            robotAdapter.FireWeapon();
        }
Exemplo n.º 2
0
 public void FireWeapon()
 {
     theRobot.SmashWitHands();
 }