|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Location
public class Location
This class represents a Solar System within our game
Field Summary | |
---|---|
private java.lang.String |
appearance
The appearance of this Location -- 'sunny', 'boring', etc. |
private Market |
market
The Location's market |
private java.lang.String |
name
The name of this Location |
private double |
posX
x pos of location in 2d array universe |
private double |
posY
y pos of location in 2d array universe |
Constructor Summary | |
---|---|
Location()
This constructor creates a default location with some set of initial values |
|
Location(java.lang.String theName,
java.lang.String theAppearance,
double thePosX,
double thePosY)
This constructor creates a location according to the passed values and leaves the market as null |
|
Location(java.lang.String theName,
java.lang.String theAppearance,
double thePosX,
double thePosY,
Market theMarket)
This constructor creates a location according to the passed values |
Method Summary | |
---|---|
java.lang.String |
getAppearance()
Get the Appearance value. |
double |
getDistance(Location other)
Calculates and returns the distance between this location and the one passed |
Market |
getMarket()
Get the Market value. |
java.lang.String |
getName()
Get the Name value. |
double |
getPosX()
Get the PosX value. |
double |
getPosY()
Get the PosY value. |
void |
setAppearance(java.lang.String newAppearance)
Set the Appearance value. |
void |
setMarket(Market newMarket)
Set the Market value. |
void |
setName(java.lang.String newName)
Set the Name value. |
void |
setPosX(double newPosX)
Set the PosX value. |
void |
setPosY(double newPosY)
Set the PosY value. |
java.lang.String |
toString()
Returns a String representation of the location (its name) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String appearance
private Market market
private java.lang.String name
private double posX
private double posY
Constructor Detail |
---|
public Location()
public Location(java.lang.String theName, java.lang.String theAppearance, double thePosX, double thePosY)
theName
- The name of the locationtheAppearance
- The appearance of the locationthePosX
- The x position of location in the 2d array universethePosY
- The y position of location in the 2d array universepublic Location(java.lang.String theName, java.lang.String theAppearance, double thePosX, double thePosY, Market theMarket)
theName
- The name of the locationtheAppearance
- The appearance of the locationthePosX
- The x position of location in the 2d array universethePosY
- The y position of location in the 2d array universetheMarket
- The value for the market at this locationMethod Detail |
---|
public java.lang.String getAppearance()
public void setAppearance(java.lang.String newAppearance)
newAppearance
- The new Appearance value.public Market getMarket()
public void setMarket(Market newMarket)
newMarket
- The new Market value.public java.lang.String getName()
public void setName(java.lang.String newName)
newName
- The new Name value.public double getPosX()
public void setPosX(double newPosX)
newPosX
- The new PosX value.public double getPosY()
public void setPosY(double newPosY)
newPosY
- The new PosY value.public double getDistance(Location other)
other
- The location to find the distance to from this location
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |