moveStrategies = new ArrayList<>();
diff --git a/src/main/java/ch/zhaw/pm2/racetrack/Track.java b/src/main/java/ch/zhaw/pm2/racetrack/Track.java
index 04ff87f..d785b46 100644
--- a/src/main/java/ch/zhaw/pm2/racetrack/Track.java
+++ b/src/main/java/ch/zhaw/pm2/racetrack/Track.java
@@ -55,7 +55,7 @@ import java.util.Scanner;
* the file contains more than {@link Config#MAX_CARS} cars
*
*
- * The Track can return a String representing the current state of the race (including car positons)
+ * The Track can return a String representing the current state of the race (including car positions)
*/
public class Track implements TrackSpecification {
@@ -71,7 +71,7 @@ public class Track implements TrackSpecification {
*
* @param trackFile Reference to a file containing the track data
* @throws FileNotFoundException if the given track file could not be found
- * @throws InvalidTrackFormatException if the track file contains invalid data (no tracklines, ...)
+ * @throws InvalidTrackFormatException if the track file contains invalid data (no track lines, ...)
*/
public Track(File trackFile) throws FileNotFoundException, InvalidTrackFormatException {
track = new ArrayList<>();
@@ -185,7 +185,7 @@ public class Track implements TrackSpecification {
}
/**
- * Method that returns the finishline as a List
+ * Method that returns the finish line as a List
*
* @return finishLine List
*/
@@ -224,7 +224,7 @@ public class Track implements TrackSpecification {
//Removes the Car at Current Pos
drawCharOnTrackIndicator(carPositionVector, ConfigSpecification.SpaceType.TRACK.getValue());
- //Redraw finishline if Car was on finish-line Position
+ //Redraw finish line if Car was on finish-line Position
for (PositionVector finishLinePositionVector : finishLine) {
if (finishLinePositionVector.equals(carPositionVector)) {
drawCharOnTrackIndicator(carPositionVector, finishTyp.getValue());
@@ -347,7 +347,7 @@ public class Track implements TrackSpecification {
* If there is a crashed car at the position, {@link #CRASH_INDICATOR} is returned.
*
* @param y position Y-value
- * @param x position X-vlaue
+ * @param x position X-value
* @param currentSpace char to return if no car is at position (x,y)
* @return character representing position (x,y) on the track
*/
diff --git a/src/main/java/ch/zhaw/pm2/racetrack/strategy/PathFinderMoveStrategy.java b/src/main/java/ch/zhaw/pm2/racetrack/strategy/PathFinderMoveStrategy.java
index c870b1f..b73000c 100644
--- a/src/main/java/ch/zhaw/pm2/racetrack/strategy/PathFinderMoveStrategy.java
+++ b/src/main/java/ch/zhaw/pm2/racetrack/strategy/PathFinderMoveStrategy.java
@@ -53,7 +53,7 @@ public class PathFinderMoveStrategy implements MoveStrategy {
}
- // while no PossibleMove crosses the finishline
+ // while no PossibleMove crosses the finish line
// every PossibleMove will be accelerated in each direction to find a Move which finishes.
while (finishedMove == null) {
List newMoves = new ArrayList<>();
@@ -164,9 +164,9 @@ public class PathFinderMoveStrategy implements MoveStrategy {
}
/**
- * check if the finishline is crossed (in correct direction) if this move is executed
+ * check if the finish line is crossed (in correct direction) if this move is executed
*
- * @return true if finishline will be crossed
+ * @return true if finish line will be crossed
*/
public boolean finished() {
return track.calculateNewWinPoints(startPosition, endPosition) == 1;
diff --git a/src/test/java/ch/zhaw/pm2/racetrack/CarTest.java b/src/test/java/ch/zhaw/pm2/racetrack/CarTest.java
index 2cd6d41..aeaf688 100644
--- a/src/test/java/ch/zhaw/pm2/racetrack/CarTest.java
+++ b/src/test/java/ch/zhaw/pm2/racetrack/CarTest.java
@@ -21,9 +21,9 @@ class CarTest {
Car car;
// Default coordinates for tests
- int DEFAULT_X = 10;
- int DEFAULT_Y = 10;
- char DEFAULT_ID = 'f';
+ final int DEFAULT_X = 10;
+ final int DEFAULT_Y = 10;
+ final char DEFAULT_ID = 'f';
/**
* Create a new Car Object and set Position to a defined Default Position
@@ -50,7 +50,7 @@ class CarTest {
/**
* - checks if the position of the car can be set and saved correctly with valid positions.
- * - checks if an exception is throwed and position keeps unchanged if invalid coordinates are entered.
+ * - checks if an exception is thrown and position keeps unchanged if invalid coordinates are entered.
*/
@Test
void setPosition() {
@@ -118,7 +118,7 @@ class CarTest {
int expectedNextPosX = DEFAULT_X;
int expectedNextPosY = DEFAULT_Y;
- //variables to save the acutal expected result of method getVelocity
+ //variables to save the actual expected result of method getVelocity
int expectedVelocityX = 0;
int expectedVelocityY = 0;
diff --git a/src/test/java/ch/zhaw/pm2/racetrack/GameTest.java b/src/test/java/ch/zhaw/pm2/racetrack/GameTest.java
index a80644e..bede5b2 100644
--- a/src/test/java/ch/zhaw/pm2/racetrack/GameTest.java
+++ b/src/test/java/ch/zhaw/pm2/racetrack/GameTest.java
@@ -23,7 +23,7 @@ class GameTest {
private final int CAR_INDEX_TWO = 1;
/**
- * This nested Class tests if the game gets initiatet correctly.
+ * This nested Class tests if the game gets initiated correctly.
*/
@Nested
@DisplayName("Test correct Setup")
@@ -123,7 +123,7 @@ class GameTest {
}
/**
- * This nested Class tests a playtrough and implements a userInterface which pretends to be a real player.
+ * This nested Class tests a play trough and implements a userInterface which pretends to be a real player.
* At the end of every Test the Userinterface stays open for 10 more sec to visualize the game.
*/
@Nested
diff --git a/src/test/java/ch/zhaw/pm2/racetrack/TrackTest.java b/src/test/java/ch/zhaw/pm2/racetrack/TrackTest.java
index eeb9e84..807a832 100644
--- a/src/test/java/ch/zhaw/pm2/racetrack/TrackTest.java
+++ b/src/test/java/ch/zhaw/pm2/racetrack/TrackTest.java
@@ -60,7 +60,7 @@ public class TrackTest {
}
@Test
- @DisplayName("Converts Trackfile correctly to List")
+ @DisplayName("Converts track file correctly to List")
void checkTrack() {
Track trackObj;
try {
@@ -153,8 +153,8 @@ public class TrackTest {
@Test
@DisplayName("Throw error if File is invalid")
void invalidTrackFile() {
- File testfile = new File(".\\src\\test\\InvalidTracks\\sameCar.txt");
- Assertions.assertThrows(InvalidTrackFormatException.class, () -> new Track(testfile));
+ File testFile = new File(".\\src\\test\\InvalidTracks\\sameCar.txt");
+ Assertions.assertThrows(InvalidTrackFormatException.class, () -> new Track(testFile));
}
}
}