|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.TeamHEC.LocomotionCommotion.Goal.Goal
public class Goal
Field Summary | |
---|---|
static GoalActor |
goalActor
|
Constructor Summary | |
---|---|
Goal(Station startStation,
Station finalStation,
Station stationVia,
java.lang.String cargo,
int reward)
Initialises a standard goal. |
|
Goal(Station startStation,
Station finalStation,
Station stationVia,
java.lang.String cargo,
int reward,
int turnLimit)
Initialises a turn-limited goal. |
Method Summary | |
---|---|
void |
assignTrain(Train train)
Assigns a goal to a train and registers listeners |
java.lang.String |
getCargo()
|
java.lang.String |
getFStation()
Gets the finish station for the goal |
int |
getReward()
Gets the reward for the goal |
java.lang.String |
getSStation()
Gets the start station |
int |
getStartTurn()
Gets the start turn for the station |
Train |
getTrain()
Gets the train assigned to the goal |
int |
getTurnLimit()
Gets the turn limit for the goal |
java.lang.String |
getVia()
Returns the name of the viaStation. |
void |
goalComplete()
Called when the goal is successfully complete, giving the player the appropriate amount of Gold and Score. |
void |
goalFailed()
Called when the goal has been failed |
boolean |
isSpecial()
Gets if the goal is a special goal |
void |
setActor(GoalActor actor)
Sets the goal actor for the goal |
void |
setSpecial(boolean special)
Sets the special flag for the goal |
void |
stationPassed(Station station,
Train train)
Listener trigger when a train passes a station |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static GoalActor goalActor
Constructor Detail |
---|
public Goal(Station startStation, Station finalStation, Station stationVia, java.lang.String cargo, int reward)
startStation
- The Station the goal starts fromfinalStation
- The Station the goal ends atstationVia
- The Station the goal wants you to travel viacargo
- The type of cargo the train is carryingreward
- The reward (currently Gold) you get for completing the Goalpublic Goal(Station startStation, Station finalStation, Station stationVia, java.lang.String cargo, int reward, int turnLimit)
startStation
- The Station the goal starts fromfinalStation
- The Station the goal ends atstationVia
- The Station the goal wants you to travel viacargo
- The type of cargo the train is carryingreward
- The reward (currently Gold) you get for completing the GoalturnLimit
- The number of turns allowed to complete the goalMethod Detail |
---|
public boolean isSpecial()
public java.lang.String getSStation()
public java.lang.String getFStation()
public int getReward()
public int getStartTurn()
public int getTurnLimit()
public void setActor(GoalActor actor)
actor
- the actor for this goalpublic java.lang.String getVia()
public java.lang.String getCargo()
public void assignTrain(Train train)
train
- The train to assign topublic Train getTrain()
public void goalComplete()
public void goalFailed()
public void stationPassed(Station station, Train train)
stationPassed
in interface RouteListener
public void setSpecial(boolean special)
special
- A boolean value for the special flag to be set to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |