net.kolls.railworld.play.script
Interface TrainActionListener


public interface TrainActionListener

This interface is used to receive some or all events regarding trains.

Author:
Steve Kollmansberger

Method Summary
 boolean trainAction(Train t, java.lang.String action)
          Informs the script that a Train action has been requested and allows it to cancel the normal behavior.
 

Method Detail

trainAction

boolean trainAction(Train t,
                    java.lang.String action)
Informs the script that a Train action has been requested and allows it to cancel the normal behavior. Only instantanous actions are available here; actions like brake and throttle can be read via the state. Behaviors: load: Occurs when one or more cars are going to be loaded unload: Occurs when one or more cars are going to be unloaded horn: Occurs when the horn will be sounded reverse: Occurs when the train's direction will be reversed split: Occurs when the train will be split selected: Occurs when the train is selected. CANNOT BE CANCELED (return value ignored) deselected: Occurs when the train is deselected. CANNOT BE CANCELED (return value ignored) step: Occurs at each step. CANNOT BE CANCELED (return value ignored)

Parameters:
t - The train involved
action - The name of the action requested
Returns:
Should the action be cancelled? (false is default, continue)