1
0
Fork 0

Achieved the Open-Closed principle for commands, and independently deployability!!!

This commit is contained in:
Xavier Fontanet 2024-06-22 19:13:40 +02:00
parent 2be1478744
commit f4fef1e9eb
9 changed files with 6 additions and 2 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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);