|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.TeamHEC.LocomotionCommotion.Train.Train
public abstract class Train
| Field Summary | |
|---|---|
int |
fuelPerTurn
|
Route |
route
|
| Constructor Summary | |
|---|---|
Train(java.lang.String name,
Fuel fuelType,
int baseSpeed,
int speedMod,
int value,
boolean inStation,
Route route,
Player owner)
The superclass of Train types, Creates a Train for player. |
|
| Method Summary | |
|---|---|
void |
addUpgrade(TrainUpgrade upgrade)
Adds an upgrade to the current train: |
void |
backupSpeedMod()
Backs up speedMod |
void |
decreaseFuelPerTurn(int by)
decrease the fuel per turn of a train |
void |
decreaseSpeedMod(int by)
decrease a train's speed modifier |
Game_Map_Train |
getActor()
|
int |
getFuelLengthCost(float length)
|
int |
getFuelPerTurn()
Get the fuel per turn of a train |
int |
getFuelRouteCost()
|
java.lang.String |
getFuelType()
|
java.lang.String |
getName()
Get the train's name |
Player |
getOwner()
Get the owner of a train |
Route |
getRoute()
Get the route of a train |
int |
getSpeed()
|
int |
getSpeedMod()
Get the speed modifier of a train |
int |
getValue()
Get the value of the train |
void |
increaseSpeedMod(int by)
Increase a train's speed modifier |
boolean |
isInStation()
Gets if a train is in a station |
void |
moveTrain()
Moves the train through it's route |
void |
removeUpgrade(TrainUpgrade upgrade)
Removes an upgrade from a train |
void |
restoreSpeedMod()
Restores speedMod from speedModBackup |
void |
setFuelPerTurn(int fuelPerTurn)
set the fuel per turn of a train |
void |
setInStation(boolean inStation)
sets if a train is in a station |
void |
setSpeedMod(int speedMod)
Set the speed modifier of a train |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int fuelPerTurn
public final Route route
| Constructor Detail |
|---|
public Train(java.lang.String name,
Fuel fuelType,
int baseSpeed,
int speedMod,
int value,
boolean inStation,
Route route,
Player owner)
fuelType - Type of fuel the train consumesspeedMod - Any speed modifications made to the trainvalue - The price of the traininStation - whether the train is currently in a stationroute - The route the train is currently usingowner - The owner of the train| Method Detail |
|---|
public Game_Map_Train getActor()
public java.lang.String getName()
public int getValue()
public Player getOwner()
public int getSpeed()
public int getSpeedMod()
public int getFuelPerTurn()
public int getFuelRouteCost()
public int getFuelLengthCost(float length)
length - the length of distance you want to travel
public java.lang.String getFuelType()
public Route getRoute()
public void setSpeedMod(int speedMod)
speedMod - public void setFuelPerTurn(int fuelPerTurn)
fuelPerTurn - public void increaseSpeedMod(int by)
by - public void decreaseSpeedMod(int by)
by - public void decreaseFuelPerTurn(int by)
by - public void setInStation(boolean inStation)
inStation - true if a the train is currently in a stationpublic boolean isInStation()
public void moveTrain()
public void backupSpeedMod()
public void restoreSpeedMod()
public void addUpgrade(TrainUpgrade upgrade)
upgrade - The upgrade to be addedpublic void removeUpgrade(TrainUpgrade upgrade)
upgrade - the upgrade to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||