mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final1.git
synced 2024-11-09 02:10:40 +00:00
Checkstyle
This commit is contained in:
parent
137b8359c6
commit
7e28bdc446
@ -49,11 +49,11 @@ public class Coach extends RollingStock {
|
||||
/**
|
||||
* The type of this coach (passenger, freight or special). TODO: consider using three classes
|
||||
*/
|
||||
private CoachType type;
|
||||
private final CoachType type;
|
||||
/**
|
||||
* The unique identifier of this coach.
|
||||
*/
|
||||
private int identifier;
|
||||
private final int identifier;
|
||||
|
||||
/**
|
||||
* Construct a new coach.
|
||||
|
@ -346,7 +346,7 @@ public class ModelRailwaySimulation {
|
||||
*/
|
||||
public void printTrains() {
|
||||
if (trains.isEmpty()) {
|
||||
Terminal.printLine("No train exists"); // TODO not in fucking spec
|
||||
Terminal.printLine("No train exists");
|
||||
return;
|
||||
}
|
||||
trains.values().forEach(Terminal::printLine);
|
||||
|
@ -11,7 +11,13 @@ import java.util.Objects;
|
||||
* @version 1.0
|
||||
*/
|
||||
public final class Track extends Rail {
|
||||
/**
|
||||
* Where this track starts.
|
||||
*/
|
||||
private final Vector2D start;
|
||||
/**
|
||||
* Where this track ends.
|
||||
*/
|
||||
private final Vector2D end;
|
||||
|
||||
/**
|
||||
|
@ -253,7 +253,7 @@ public final class Train {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a set of the rails this train occupies
|
||||
* @return a set of the rails this train occupies currently
|
||||
*/
|
||||
public Set<Rail> getOccupiedRails() {
|
||||
// make sure caller can not modify internal state
|
||||
|
@ -26,11 +26,11 @@ public class TrainSet extends RollingStock {
|
||||
/**
|
||||
* Series (class) of this train set.
|
||||
*/
|
||||
private String series;
|
||||
private final String series;
|
||||
/**
|
||||
* Name of this train set. TODO: create NamedRollingStock class
|
||||
*/
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* Construct a new train set.
|
||||
|
@ -15,11 +15,11 @@ public class AddTrack extends Command {
|
||||
/**
|
||||
* Start position of the new track.
|
||||
*/
|
||||
private Vector2D start;
|
||||
private final Vector2D start;
|
||||
/**
|
||||
* End position of the new track.
|
||||
*/
|
||||
private Vector2D end;
|
||||
private final Vector2D end;
|
||||
|
||||
/**
|
||||
* Construct a new 'add track' command.
|
||||
|
@ -14,7 +14,7 @@ import java.util.regex.Pattern;
|
||||
* @author Arne Keller
|
||||
* @version 1.0
|
||||
*/
|
||||
public class CommandFactory {
|
||||
public final class CommandFactory {
|
||||
private static final String ADD_TRACK = "add track";
|
||||
private static final Pattern ADD_TRACK_ARGUMENTS
|
||||
= Pattern.compile(" \\(([+-]?\\d+,[+-]?\\d+)\\) -> \\(([+-]?\\d+,[+-]?\\d+)\\)");
|
||||
|
@ -9,6 +9,9 @@ import edu.kit.informatik.model.ModelRailwaySimulation;
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ShowTrain extends Command {
|
||||
/**
|
||||
* Identifier of the train to display.
|
||||
*/
|
||||
private final int id;
|
||||
|
||||
/**
|
||||
|
@ -9,6 +9,9 @@ import edu.kit.informatik.model.ModelRailwaySimulation;
|
||||
* @version 1.0
|
||||
*/
|
||||
public class Step extends Command {
|
||||
/**
|
||||
* Amount of steps to perform (= speed).
|
||||
*/
|
||||
private final short speed;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user