net.kolls.railworld.tuic
Class TrainEndPointFinder

java.lang.Object
  extended by net.kolls.railworld.TrainUIController
      extended by net.kolls.railworld.tuic.TrainEndPointFinder

public class TrainEndPointFinder
extends TrainUIController

Finds the empty point of a train. Used, for example, for reversing a train.

Author:
Steve Kollmansberger

Field Summary
 CLoc p
          The endpoint, once found.
 
Constructor Summary
TrainEndPointFinder()
           
 
Method Summary
 void car(Car c, CLoc b, CLoc pos)
          For each Car, including a beginning and ending position.
 void segment(Car c, java.awt.geom.Line2D l)
          For each visible segment (there may be multiple segments per car, or even 0 if the car is hidden).
 
Methods inherited from class net.kolls.railworld.TrainUIController
act
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

p

public CLoc p
The endpoint, once found.

Constructor Detail

TrainEndPointFinder

public TrainEndPointFinder()
Method Detail

segment

public void segment(Car c,
                    java.awt.geom.Line2D l)
Description copied from class: TrainUIController
For each visible segment (there may be multiple segments per car, or even 0 if the car is hidden).

Specified by:
segment in class TrainUIController
Parameters:
c - The Car involved.
l - The current segment. There may be multiple calls to segment per Car.

car

public void car(Car c,
                CLoc b,
                CLoc pos)
Description copied from class: TrainUIController
For each Car, including a beginning and ending position. These are given regardless of whether or not the Car is all or partially hidden.

Specified by:
car in class TrainUIController
Parameters:
c - The Car involved.
b - Starting position.
pos - Final position.