jfreerails.controller
Class CalcNearestCity

java.lang.Object
  extended by jfreerails.controller.CalcNearestCity

public class CalcNearestCity
extends java.lang.Object

Class to find the nearest city and return that name, so that a station can be named appropriately. Date: 12th April 2003

Author:
Scott Bennett

Field Summary
private  ReadOnlyWorld w
           
private  int x
           
private  int y
           
 
Constructor Summary
CalcNearestCity(ReadOnlyWorld world, int x, int y)
           
 
Method Summary
 java.lang.String findNearestCity()
           
private  double getDistance(int cityX, int cityY)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

private final int x

y

private final int y

w

private final ReadOnlyWorld w
Constructor Detail

CalcNearestCity

public CalcNearestCity(ReadOnlyWorld world,
                       int x,
                       int y)
Method Detail

findNearestCity

public java.lang.String findNearestCity()

getDistance

private double getDistance(int cityX,
                           int cityY)