예제 #1
0
파일: Facing.cs 프로젝트: masudio/MarsRover
 public override void Execute(IRover rover, Instruction instruction)
 {
     switch(instruction.GetInstruction())
     {
         case Instruction.TurnLeft:
             rover.SetFacing(West);
             break;
         case Instruction.TurnRight:
             rover.SetFacing(East);
             break;
         case Instruction.MoveForward:
             rover.MoveNorth();
             break;
         default:
             throw new ArgumentException("Incorrect facing code.");
     }
 }