コード例 #1
0
ファイル: Program.cs プロジェクト: Kalle-kula/adapterUppgift
        static void Main(string[] args)
        {
            Human Kalle = new Human();
            Robot Lasse = new Robot();
            IHumanBehaviour robotAdapter = new RobotAdapter(Lasse);

            Console.WriteLine("The human:");

            Kalle.sleep();
            Kalle.talk();
            Kalle.walk();
            Console.WriteLine();

            Console.WriteLine("The robot:");
            Lasse.recharge();
            Lasse.communicate();
            Lasse.rolls();
            Console.WriteLine();

            Console.WriteLine("The humaniod:");
            robotAdapter.sleep();
            robotAdapter.talk();
            robotAdapter.walk();
            Console.WriteLine();
            Console.ReadLine();
        }
コード例 #2
0
 public RobotAdapter(Robot humanoid)
 {
     theRobot = humanoid;
 }