1
0
Fork 0

better naming description

This commit is contained in:
Xavier Fontanet 2024-06-22 19:21:31 +02:00
parent f4fef1e9eb
commit cbbc40c50a
8 changed files with 14 additions and 14 deletions

View File

@ -8,7 +8,7 @@ public interface RotableRiderRover {
void moveTowards(Direction direction); void moveTowards(Direction direction);
void rotateTowards(MarsRover.Rotation rotation); void rotateTowards(Rotation rotation);
Coordinates getCurrentCoordinates(); Coordinates getCurrentCoordinates();

View File

@ -1,5 +1,5 @@
package cat.hack3.codingtests.marsrover; package cat.hack3.codingtests.marsrover;
public interface MarsRoverCommand { public interface RoverCommand {
void execute(); void execute();
} }

View File

@ -1,6 +1,6 @@
package cat.hack3.codingtests.marsrover; package cat.hack3.codingtests.marsrover;
public class MoveBackwardsCommand implements MarsRoverCommand { public class MoveBackwardsCommand implements RoverCommand {
private final RotableRiderRover rover; private final RotableRiderRover rover;
public MoveBackwardsCommand(RotableRiderRover rover) { public MoveBackwardsCommand(RotableRiderRover rover) {

View File

@ -1,6 +1,6 @@
package cat.hack3.codingtests.marsrover; package cat.hack3.codingtests.marsrover;
public class MoveForwardCommand implements MarsRoverCommand{ public class MoveForwardCommand implements RoverCommand {
private final RotableRiderRover rover; private final RotableRiderRover rover;
public MoveForwardCommand(RotableRiderRover rover) { public MoveForwardCommand(RotableRiderRover rover) {

View File

@ -2,7 +2,7 @@ package cat.hack3.codingtests.marsrover;
import static cat.hack3.codingtests.marsrover.RotableRiderRover.Rotation.LEFT; import static cat.hack3.codingtests.marsrover.RotableRiderRover.Rotation.LEFT;
public class TurnLeftCommand implements MarsRoverCommand{ public class TurnLeftCommand implements RoverCommand {
private final RotableRiderRover rover; private final RotableRiderRover rover;
public TurnLeftCommand(RotableRiderRover rover) { public TurnLeftCommand(RotableRiderRover rover) {

View File

@ -2,7 +2,7 @@ package cat.hack3.codingtests.marsrover;
import static cat.hack3.codingtests.marsrover.RotableRiderRover.Rotation.RIGHT; import static cat.hack3.codingtests.marsrover.RotableRiderRover.Rotation.RIGHT;
public class TurnRightCommand implements MarsRoverCommand{ public class TurnRightCommand implements RoverCommand {
private final RotableRiderRover rover; private final RotableRiderRover rover;
public TurnRightCommand(RotableRiderRover rover) { public TurnRightCommand(RotableRiderRover rover) {

View File

@ -14,10 +14,10 @@ import static org.testng.Assert.assertEquals;
public class MarsRoverTest { public class MarsRoverTest {
private MarsRover rover; private MarsRover rover;
private MarsRoverCommand moveForwardCommand; private RoverCommand moveForwardCommand;
private MarsRoverCommand moveBackwardsCommand; private RoverCommand moveBackwardsCommand;
private MarsRoverCommand turnLeftCommand; private RoverCommand turnLeftCommand;
private MarsRoverCommand turnRightCommand; private RoverCommand turnRightCommand;
@BeforeMethod @BeforeMethod
public void setUp() { public void setUp() {

View File

@ -9,10 +9,10 @@ import static cat.hack3.codingtests.marsrover.ui.console.UICommons.output;
public class RoverCommandsPerformer { public class RoverCommandsPerformer {
private final Scanner reader; private final Scanner reader;
private final MarsRoverCommand moveForwardCommand; private final RoverCommand moveForwardCommand;
private final MarsRoverCommand moveBackwardsCommand; private final RoverCommand moveBackwardsCommand;
private final MarsRoverCommand turnLeftCommand; private final RoverCommand turnLeftCommand;
private final MarsRoverCommand turnRightCommand; private final RoverCommand turnRightCommand;
public RoverCommandsPerformer(Scanner reader, RotableRiderRover rover) { public RoverCommandsPerformer(Scanner reader, RotableRiderRover rover) {
this.reader = reader; this.reader = reader;