Achieved the Open-Closed principle for commands, and independently deployability!!!
This commit is contained in:
parent
2be1478744
commit
f4fef1e9eb
|
@ -10,6 +10,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>rover-commands</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
|
|
@ -22,6 +22,11 @@
|
|||
<artifactId>mars-station</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cat.hack3.codingtests</groupId>
|
||||
<artifactId>rover-commands</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -9,7 +9,6 @@ import static cat.hack3.codingtests.marsrover.ui.console.UICommons.output;
|
|||
|
||||
public class RoverCommandsPerformer {
|
||||
private final Scanner reader;
|
||||
private final RotableRiderRover rover;
|
||||
private final MarsRoverCommand moveForwardCommand;
|
||||
private final MarsRoverCommand moveBackwardsCommand;
|
||||
private final MarsRoverCommand turnLeftCommand;
|
||||
|
@ -17,7 +16,6 @@ public class RoverCommandsPerformer {
|
|||
|
||||
public RoverCommandsPerformer(Scanner reader, RotableRiderRover rover) {
|
||||
this.reader = reader;
|
||||
this.rover = rover;
|
||||
moveForwardCommand = new MoveForwardCommand(rover);
|
||||
moveBackwardsCommand = new MoveBackwardsCommand(rover);
|
||||
turnLeftCommand = new TurnLeftCommand(rover);
|
||||
|
|
Loading…
Reference in New Issue