|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
net.kolls.railworld.play.RailAccident
public abstract class RailAccident
Describes an accident and the train(s) involed. In the future, this may be replaced with an abstract class or interface, and the various kinds of accidents be subclasses. This would allow scripts to extend the game and add their own accident types (e.g. failing to blow horn before crossing)
| Field Summary | |
|---|---|
java.awt.geom.Point2D |
pos
The location of the accident. |
Train |
t1
The trains involved in the accident. |
Train |
t2
The other train. |
| Constructor Summary | |
|---|---|
RailAccident(Train first,
Train second,
java.awt.geom.Point2D p)
Create a rail accident. |
|
| Method Summary | |
|---|---|
abstract java.lang.String |
midbody()
The midbody of the report is the section that comes before the second train, if any, is described but after the first train is described. |
abstract java.lang.String |
title()
The title of this accident type |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public Train t1
public Train t2
public java.awt.geom.Point2D pos
| Constructor Detail |
|---|
public RailAccident(Train first,
Train second,
java.awt.geom.Point2D p)
first - The first train. Must not be null.second - The second train. May be null if only one train involved.p - The point on the map where the accident occured.| Method Detail |
|---|
public abstract java.lang.String title()
public abstract java.lang.String midbody()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||