net.kolls.railworld.play.ra
Class SideOn
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
net.kolls.railworld.play.RailAccident
net.kolls.railworld.play.ra.SideOn
- All Implemented Interfaces:
- java.io.Serializable
public class SideOn
- extends RailAccident
A merging collision or overlap which occurs which two trains merge at a switch,
cross at a four-way, or enter on top of each other.
- Author:
- Steve Kollmansberger
- See Also:
- Serialized Form
|
Constructor Summary |
SideOn(Train first,
Train second,
java.awt.geom.Point2D p)
Create a side-on collision. |
|
Method Summary |
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. |
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 |
SideOn
public SideOn(Train first,
Train second,
java.awt.geom.Point2D p)
- Create a side-on collision. Simply calls super constructor.
- Parameters:
first - First trainsecond - Second trainp - Location of accident
midbody
public java.lang.String midbody()
- Description copied from class:
RailAccident
- 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.
It is a sentence fragment like "collided head-on with a"
(which becomes "A southbound 40-ton train collided head-on with a 30-ton train...")
Do not end the phrase with a period or start with a capital.
If you want the direction for the second train, you can insert {2d} into the string
and that will be replaced by the second train direction.
- Specified by:
midbody in class RailAccident
- Returns:
- midbody phrase
title
public java.lang.String title()
- Description copied from class:
RailAccident
- The title of this accident type
- Specified by:
title in class RailAccident
- Returns:
- Title based on kind of accident