net.kolls.railworld.tuic
Class TrainClickTest

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

public class TrainClickTest
extends TrainUIController

Given a position on the map, determine if it is within a train. If so, indicate which car it falls within.

Author:
Steve Kollmansberger

Field Summary
 Car cc
          If the position falls within a train, this will be set to the Car it hits.
 
Constructor Summary
TrainClickTest(int vx, int vy)
          Creates a new TrainClickTest for a given position.
 
Method Summary
 void car(Car c, CLoc b, CLoc e)
          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

cc

public Car cc
If the position falls within a train, this will be set to the Car it hits. Otherwise null.

Constructor Detail

TrainClickTest

public TrainClickTest(int vx,
                      int vy)
Creates a new TrainClickTest for a given position.

Parameters:
vx - The X coordinate on the map
vy - The Y coordinate on the map
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 e)
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.
e - Final position.