|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pegacat.vcf.data.VoyagerLocation
A location in voyager, being a) a star, world, moon location, and b) an x,y,z starmap position
Field Summary | |
int |
moon
|
int |
starNo
|
static java.util.Hashtable |
starpos
|
static int |
UNKNOWN
|
static char |
UNKNOWNC
|
static java.lang.String |
UNKNOWNS
|
char |
world
|
int |
x
|
int |
y
|
int |
z
|
Constructor Summary | |
VoyagerLocation(int X,
int Y,
int Z)
Sets a voyager location purely in terms of starmap x,y,z co-ordinates. |
|
VoyagerLocation(int starNo,
int X,
int Y,
int Z)
Sets a voyager location purely in terms of starmap x,y,z co-ordinates. |
|
VoyagerLocation(java.lang.String position)
Creates a location specified by a string of form [s]SSS[World letter][Moon number] such as '105a2', '497', 's497', 'w232b'. |
Method Summary | |
double |
distanceFrom(VoyagerLocation other)
return distance from another location. |
static int[] |
getPosition(java.lang.String position)
Returns the starNo map position of a starNo, world or moon as a three int array [x,y,z]. |
static java.lang.String |
getStarName(java.lang.String position)
Returns the unadorned starNo name from a starNo, world or moon string. |
int |
getX()
returns the starNo map x co-ordinate. |
int |
getY()
returns the starNo map y co-ordinate. |
int |
getZ()
returns the starNo map z co-ordinate. |
int |
hashCode()
|
static void |
registerDataLayer(DataLayer current)
Registers the current data layer. |
protected void |
setCoOrds()
This attempts to look up the Star array, using this object's starNo number, and thus set the x/y/z position of the object. |
void |
setNamedPosition()
returns the named position, such as 's112' or 'w212b5', in canonical '[char][number][char][number]' form. |
protected void |
setPosition(java.lang.String position)
This sets the canonical position of the location by parsing any of the generic world/star description strings. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int UNKNOWN
public static java.lang.String UNKNOWNS
public static char UNKNOWNC
public int starNo
public char world
public int moon
public int x
public int y
public int z
public static java.util.Hashtable starpos
Constructor Detail |
public VoyagerLocation(java.lang.String position)
public VoyagerLocation(int X, int Y, int Z)
public VoyagerLocation(int starNo, int X, int Y, int Z)
Method Detail |
protected void setPosition(java.lang.String position)
public int getX()
public int getY()
public int getZ()
protected void setCoOrds()
public void setNamedPosition()
public java.lang.String toString()
toString
in class java.lang.Object
public double distanceFrom(VoyagerLocation other)
public static java.lang.String getStarName(java.lang.String position)
public static int[] getPosition(java.lang.String position)
the
- string name of a location (e.g. 's178' or 'w133b4'public static void registerDataLayer(DataLayer current)
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |