예제 #1
0
 public TextCommander(ICleanerPilot cleaner)
 {
     this.cleaner     = cleaner;
     commandsByLetter = new Dictionary <string, Action <int> >
     {
         { "S", steps => cleaner.CleanSouth(steps) },
         { "N", steps => cleaner.CleanNorth(steps) },
         { "E", steps => cleaner.CleanEast(steps) },
         { "W", steps => cleaner.CleanWest(steps) }
     };
 }
 public TextCommander(ICleanerPilot cleaner)
 {
     this.cleaner = cleaner;
     commandsByLetter=new Dictionary<string, Action<int>>
     {
         { "S", steps=>cleaner.CleanSouth(steps) },
         { "N", steps=>cleaner.CleanNorth(steps) },
         { "E", steps=>cleaner.CleanEast(steps) },
         { "W", steps=>cleaner.CleanWest(steps) }
     };
 }