kit-programmieren-ws1920-fi.../src/edu/kit/informatik/SteamEngine.java

36 lines
1.0 KiB
Java
Raw Normal View History

2020-02-15 14:17:23 +00:00
package edu.kit.informatik;
public class SteamEngine extends Engine {
public SteamEngine(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("s %s %s %d %b %b", series, name, length, couplingFront, couplingBack);
}
private static final String[] STEAM_ENGINE_TEXT = new String[] {
" ++ +------",
" || |+-+ | ",
" /---------|| | | ",
" + ======== +-+ | ",
" _|--/~\\------/~\\-+ ",
"//// \\_/ \\_/ "
};
@Override
public String[] textRepresentation() {
return STEAM_ENGINE_TEXT;
}
@Override
public String description() {
return "steam engine";
}
}