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."); } }
public abstract void Execute(IRover rover, Instruction instruction);