2020-02-16 14:01:33 +00:00
|
|
|
package edu.kit.informatik.model;
|
2020-02-15 14:17:23 +00:00
|
|
|
|
2020-02-15 15:11:13 +00:00
|
|
|
/**
|
|
|
|
* Diesel engine.
|
|
|
|
*
|
|
|
|
* @author Arne Keller
|
|
|
|
* @version 1.0
|
|
|
|
*/
|
2020-02-15 14:17:23 +00:00
|
|
|
public class DieselEngine extends Engine {
|
2020-02-15 15:11:13 +00:00
|
|
|
private static final String[] DIESEL_ENGINE_TEXT = new String[] {
|
|
|
|
" _____________|____ ",
|
|
|
|
" /_| ____________ |_\\ ",
|
|
|
|
"/ |____________| \\",
|
|
|
|
"\\ /",
|
|
|
|
" \\__________________/ ",
|
|
|
|
" (O)(O) (O)(O) ",
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct a new diesel engine.
|
|
|
|
* @param series series/class of engine
|
|
|
|
* @param name name of engine
|
|
|
|
* @param length length of engine
|
|
|
|
* @param couplingFront whether the engine should have a front coupling
|
|
|
|
* @param couplingBack whether the engine should have a back coupling
|
|
|
|
*/
|
|
|
|
public DieselEngine(final String series, final String name, final int length,
|
|
|
|
final boolean couplingFront, final boolean couplingBack) {
|
2020-02-15 14:17:23 +00:00
|
|
|
super.name = name;
|
|
|
|
super.series = series;
|
|
|
|
super.length = length;
|
|
|
|
super.couplingFront = couplingFront;
|
|
|
|
super.couplingBack = couplingBack;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return String.format("d %s %s %d %b %b", series, name, length, couplingFront, couplingBack);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String[] textRepresentation() {
|
|
|
|
return DIESEL_ENGINE_TEXT;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String description() {
|
|
|
|
return "diesel engine";
|
|
|
|
}
|
|
|
|
}
|