mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final1.git
synced 2024-11-24 17:34:58 +00:00
44 lines
1.2 KiB
Java
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";
|
|
}
|
|
}
|