public Rover(Coordinates coordinates, string direction) { CurrentCoordinates = coordinates; RoverNavigator = new RoverNavigator(this); RoverRotator = new RoverRotator(this); CurrentDirection = direction; }
public void Navigate(char[] instructions) { foreach (var instruction in instructions) { switch (instruction) { case 'M': RoverNavigator.Navigate(); break; case 'L': RoverRotator.Turn("L"); break; case 'R': RoverRotator.Turn("R"); break; } ; } }