コード例 #1
0
 public void Visit(HastyPerson e)
 {
     if (e.VeryHasty())
     {
         Console.WriteLine("I drive as fast as I can");
     }
     else
     {
         Console.WriteLine("I drive fast");
     }
 }
コード例 #2
0
 public void Visit(HastyPerson e)
 {
     if (e.VeryHasty())
     {
         Console.WriteLine("I drive slowly. Clink clink clink...");
     }
     else
     {
         Console.WriteLine("I drive very slowly. Clink clink clink...");
     }
 }