kit-programmieren-ws1920-fi.../src/edu/kit/informatik/model/FreightCoach.java
2020-02-20 14:11:26 +01:00

46 lines
1.3 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() {
// make sure caller can not modify private data
return FREIGHT_TEXT.clone();
}
@Override
public String getType() {
return "f";
}
}