kit-programmieren-ws1920-fi.../src/edu/kit/informatik/model/FreightCoach.java
2020-02-19 18:44:25 +01:00

44 lines
1.2 KiB
Java

package edu.kit.informatik.model;
import edu.kit.informatik.ui.InvalidInputException;
public class FreightCoach extends Coach {
/**
* ASCII art representation of a freight coach.
*/
private static final String[] FREIGHT_TEXT = new String[] {
"| |",
"| |",
"| |",
"|__________________|",
" (O) (O) "
};
/**
* Construct a new freight coach.
* @param identifier identifier to use
* @param length length of coach
* @param couplingFront whether the coach should have a front coupling
* @param couplingBack whether the coach should have a back coupling
* @throws InvalidInputException on invalid user input (zero-sized coach)
*/
public FreightCoach(int identifier, int length, boolean couplingFront, boolean couplingBack) throws InvalidInputException {
super(identifier, length, couplingFront, couplingBack);
}
@Override
public String description() {
return "freight coach";
}
@Override
public String[] textRepresentation() {
return FREIGHT_TEXT;
}
@Override
public String getType() {
return "f";
}
}