better naming description
This commit is contained in:
parent
f4fef1e9eb
commit
cbbc40c50a
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package cat.hack3.codingtests.marsrover;
|
package cat.hack3.codingtests.marsrover;
|
||||||
|
|
||||||
public interface MarsRoverCommand {
|
public interface RoverCommand {
|
||||||
void execute();
|
void execute();
|
||||||
}
|
}
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue