mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final1.git
synced 2024-11-25 01:44:59 +00:00
50 lines
1.0 KiB
Java
50 lines
1.0 KiB
Java
package edu.kit.informatik.model;
|
|
|
|
/**
|
|
* Generic engine, is usually either diesel, steam or electric.
|
|
*
|
|
* @author Arne Keller
|
|
* @version 1.0
|
|
*/
|
|
public abstract class Engine extends RollingStock {
|
|
/**
|
|
* Series/class of this engine.
|
|
*/
|
|
private String series;
|
|
/**
|
|
* Name of this engine.
|
|
*/
|
|
private String name;
|
|
|
|
protected Engine(final String series, final String name, final int length,
|
|
final boolean couplingFront, final boolean couplingBack) {
|
|
super(length, couplingFront, couplingBack);
|
|
this.series = series;
|
|
this.name = name;
|
|
}
|
|
|
|
/**
|
|
* @return the name of this engine
|
|
*/
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
/**
|
|
* @return the series of this engine
|
|
*/
|
|
public String getSeries() {
|
|
return series;
|
|
}
|
|
|
|
@Override
|
|
public String getIdentifier() {
|
|
return String.format("%s-%s", series, getName());
|
|
}
|
|
|
|
@Override
|
|
public boolean canCoupleTo(RollingStock rollingStock) {
|
|
return true;
|
|
}
|
|
}
|