mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final1.git
synced 2024-11-24 17:34:58 +00:00
36 lines
1023 B
Java
36 lines
1023 B
Java
|
package edu.kit.informatik;
|
||
|
|
||
|
public class DieselEngine extends Engine {
|
||
|
public DieselEngine(final String series, final String name, final int length, final boolean couplingFront, final boolean couplingBack) {
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
private static final String[] DIESEL_ENGINE_TEXT = new String[] {
|
||
|
" _____________|____ ",
|
||
|
" /_| ____________ |_\\ ",
|
||
|
"/ |____________| \\",
|
||
|
"\\ /",
|
||
|
" \\__________________/ ",
|
||
|
" (O)(O) (O)(O) ",
|
||
|
};
|
||
|
|
||
|
@Override
|
||
|
public String[] textRepresentation() {
|
||
|
return DIESEL_ENGINE_TEXT;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public String description() {
|
||
|
return "diesel engine";
|
||
|
}
|
||
|
}
|