code cleanup

This commit is contained in:
Andrin Fassbind 2022-03-25 20:28:47 +01:00
parent a2560ce5d5
commit a9366de7bc
3 changed files with 7 additions and 6 deletions

View File

@ -41,5 +41,5 @@ The winner gets determined automatically. <br> The car that first passes the fin
We choose a simple branching model where all starting features got a branch and where merged into the main branch, some branches who needed unfinished code to be completed where taken from the game branch but merged into the main at the end as well.<br> Since there was just one end product we abstained from using a development branch and merges where done straight into main branch.<br>Commits which contain only documentation and doesn't change any functionality are committed directly into the Main branch. We choose a simple branching model where all starting features got a branch and where merged into the main branch, some branches who needed unfinished code to be completed where taken from the game branch but merged into the main at the end as well.<br> Since there was just one end product we abstained from using a development branch and merges where done straight into main branch.<br>Commits which contain only documentation and doesn't change any functionality are committed directly into the Main branch.
## Class Diagramm ## Class Diagramm
This Class Diagramm is additional to the Class Diagramm given in the Anleitung.pdf<br> This Class Diagramm is additional to the Class Diagramm given in the Anleitung.pdf<br><br>
![Classdiagramm of this program](./Klassendiagramm.svg) ![Classdiagramm of this program](./Klassendiagramm.svg)

View File

@ -34,14 +34,14 @@ public class PathFollowerMoveStrategy implements MoveStrategy {
/** /**
* Constructor to create a new PathFollowerMoveStrategy for a car. * Constructor to create a new PathFollowerMoveStrategy for a car.
* @param path The location where the file is saved * @param trackFile The location where the file is saved
* @param startPosition The start position of the car * @param startPosition The start position of the car
* @throws FileNotFoundException If the file with the given path does not exist. * @throws FileNotFoundException If the file with the given path does not exist.
*/ */
public PathFollowerMoveStrategy(String path, PositionVector startPosition) throws FileNotFoundException { public PathFollowerMoveStrategy(File trackFile, PositionVector startPosition) throws FileNotFoundException {
pointList = new ArrayList<>(); pointList = new ArrayList<>();
pointer = 0; pointer = 0;
readFile(new File(path)); readFile(trackFile);
currentPosition = startPosition; currentPosition = startPosition;
currentVelocity = new PositionVector(0, 0); currentVelocity = new PositionVector(0, 0);
} }

View File

@ -2,13 +2,14 @@ package ch.zhaw.pm2.racetrack;
import ch.zhaw.pm2.racetrack.given.ConfigSpecification; import ch.zhaw.pm2.racetrack.given.ConfigSpecification;
import org.junit.jupiter.api.*; import org.junit.jupiter.api.*;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* This Class tests the track
*/
public class TrackTest { public class TrackTest {
Track trackObj; Track trackObj;