mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final1.git
synced 2024-11-24 01:15:05 +00:00
Checkstyle
This commit is contained in:
parent
840c29f000
commit
428e1862fc
@ -3,8 +3,8 @@ package edu.kit.informatik.model;
|
||||
import edu.kit.informatik.ui.InvalidInputException;
|
||||
|
||||
/**
|
||||
* A rolling stock. Is usually an engine, train set or coach.
|
||||
*
|
||||
* A rolling stock with a specific integer length and couplings. Is usually an engine, train set or coach.
|
||||
*
|
||||
* @author Arne Keller
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -24,6 +24,7 @@ public abstract class RollingStock {
|
||||
|
||||
/**
|
||||
* Initialize a rolling stock.
|
||||
*
|
||||
* @param length length of this rolling stock
|
||||
* @param couplingFront whether this rolling stock should have a front coupling
|
||||
* @param couplingBack whether this rolling stock should have a back coupling
|
||||
@ -43,6 +44,8 @@ public abstract class RollingStock {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the identifier of this rolling stock.
|
||||
*
|
||||
* @return identifier of this rolling stock
|
||||
*/
|
||||
public abstract String getIdentifier();
|
||||
|
@ -343,6 +343,7 @@ public final class Train {
|
||||
|
||||
/**
|
||||
* Update the direction of this train.
|
||||
*
|
||||
* @param newDirection new direction of the train
|
||||
*/
|
||||
public void setDirection(final Vector2D newDirection) {
|
||||
@ -369,6 +370,8 @@ public final class Train {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this train is on the specified position. This includes the front and back of the train.
|
||||
*
|
||||
* @param point position to check
|
||||
* @return whether this train is on the specified position
|
||||
*/
|
||||
@ -377,15 +380,18 @@ public final class Train {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this train is on any of the provided positions. This includes the front and back of the train.
|
||||
*
|
||||
* @param positions list of positions to check
|
||||
* @return whether this train is on any of the specified positions
|
||||
*/
|
||||
public boolean isOnAnyPosition(final List<Vector2D> positions) {
|
||||
public boolean isOnAnyPosition(List<Vector2D> positions) {
|
||||
return position != null && position.stream().anyMatch(positions::contains);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the length of this train, summing the length of all rolling stocks.
|
||||
*
|
||||
* @return total length of this train
|
||||
*/
|
||||
public long getLength() {
|
||||
|
Loading…
Reference in New Issue
Block a user