public class Station extends MapObj
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<StationListener> |
listeners |
double |
mindistance |
actor, connections, x, y
Constructor and Description |
---|
Station(java.lang.String name,
int baseValue,
Resource resourceType,
int baseFuelOut,
Line[] line,
int rentValue,
float x,
float y) |
Modifier and Type | Method and Description |
---|---|
void |
addRentValueMod(int add) |
void |
addResourceOutMod(int add) |
void |
addValueMod(int add) |
int |
getBaseRentValue() |
int |
getBaseResourceOut() |
int |
getBaseValue() |
Line[] |
getLineType() |
java.lang.String |
getName()
Returns the name of the station or junction the MapObj represents
|
Player |
getOwner() |
int |
getRentValueMod() |
int |
getResourceOutMod() |
java.lang.String |
getResourceString() |
Resource |
getResourceType() |
Station |
getStation() |
Game_Map_Station |
getStationActor() |
int |
getTotalRent() |
int |
getTotalResourceOut() |
int |
getTotalValue() |
int |
getValueMod() |
void |
notifyStationPurchased(Station station,
Player player)
Called when you want to notify listeners that a station has changed ownership, such as
changing the texture on the map or setting the text of the players gold
|
void |
register(StationListener newListener)
Registers an object implementing the StationListener by adding it to the listeners array
|
void |
setOwner(Player newOwner)
Changes the owner of this station and notifies listeners
|
void |
setRentValueMod(int value) |
void |
setResourceOutMod(int mod) |
void |
setValueMod(int value) |
void |
subRentValueMod(int sub) |
void |
subResourceOutMod(int sub) |
void |
subValueMod(int sub) |
void |
unregister(StationListener s)
Removes object implementing StationListener so it no longer recieves updates
|
public double mindistance
protected java.util.ArrayList<StationListener> listeners
public Station(java.lang.String name, int baseValue, Resource resourceType, int baseFuelOut, Line[] line, int rentValue, float x, float y)
name
- baseValue
- The value of the stationresourceType
- The type of resource the station producesbaseFuelOut
- The amount of resource the station produces each turn, without up line bonusesline
- Array of lines the station belongs torentValue
- How much it costs to rentx
- Coordinate of position x on mapy
- Coordinate of position y on mappublic Station getStation()
getStation
in class MapObj
public Game_Map_Station getStationActor()
public java.lang.String getName()
MapObj
public java.lang.String getResourceString()
public int getBaseValue()
public int getValueMod()
public void setValueMod(int value)
public void addValueMod(int add)
public void subValueMod(int sub)
public int getTotalValue()
public Resource getResourceType()
public int getBaseResourceOut()
public int getResourceOutMod()
public void setResourceOutMod(int mod)
mod
- the amount resourceOut will be increased by, Total = Base + Modpublic void addResourceOutMod(int add)
public void subResourceOutMod(int sub)
public int getTotalResourceOut()
public int getBaseRentValue()
public int getRentValueMod()
public void setRentValueMod(int value)
public void addRentValueMod(int add)
public void subRentValueMod(int sub)
public int getTotalRent()
public Player getOwner()
public void setOwner(Player newOwner)
newOwner
- public Line[] getLineType()
public void register(StationListener newListener)
newListener
- the object to be addedpublic void unregister(StationListener s)
s
- the object to be removed