|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Vehicle
public class Vehicle
This class represents a Vehicle (player) within our game.
Field Summary | |
---|---|
private Inventory |
myInventory
The Vehicle's inventory. |
private Location |
myLocation
The current Location of the Vehicle. |
private Party |
theParty
Party includes leader and other members. |
private double |
totalDistanceTraveled
The Vehicle's odometer -- how far it has traveled |
private double |
totalTimeTaken
The total amount of trip time. |
private java.lang.String |
vehicleType
Describe the type of the vehicle. |
Constructor Summary | |
---|---|
Vehicle()
Default Vehicle constructor |
|
Vehicle(int partySize)
Specific Vehicle constructor to create a Vehicle with a particular-sized Party |
Method Summary | |
---|---|
void |
addLeader(java.lang.String name)
Adds a leader to the Party by calling Party.addLeader(java.lang.String) |
void |
addPartyMember(java.lang.String name)
Adds a party member to the Party by calling Party.addPartyMember(java.lang.String) |
void |
addToMoney(double amount)
Increases the vehcile's (player's) money by the amount passed |
Inventory |
getInventory()
|
Person |
getLeader()
|
Location |
getLocation()
|
double |
getMoney()
|
Party |
getParty()
|
double |
getTotalDistanceTraveled()
|
double |
getTotalTimeTaken()
|
java.lang.String |
getVehicleType()
|
void |
move()
|
void |
setInventory(Inventory theInventory)
|
void |
setLocation(Location theLocation)
|
void |
setMoney(double money)
|
void |
setParty(Party party)
|
void |
setTotalDistanceTraveled(double totalDistanceTraveled)
|
void |
setTotalTimeTaken(double totalTimeTaken)
|
void |
setVehicleType(java.lang.String vehicleType)
|
void |
subtractFromMoney(double amount)
Decreases the vehicle's (player's) money by the amount passed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Party theParty
private java.lang.String vehicleType
private Location myLocation
private Inventory myInventory
private double totalDistanceTraveled
private double totalTimeTaken
Constructor Detail |
---|
public Vehicle()
public Vehicle(int partySize)
partySize
- The size of the party to create for the Vehicle.Method Detail |
---|
public void addLeader(java.lang.String name)
Party.addLeader(java.lang.String)
name
- The name to assign to the leader.public void addPartyMember(java.lang.String name)
Party.addPartyMember(java.lang.String)
name
- The name to assign to the Party member.public Inventory getInventory()
public void setInventory(Inventory theInventory)
theInventory
- The inventory to set.public Person getLeader()
public Location getLocation()
public void setLocation(Location theLocation)
theLocation
- The location to set.public double getMoney()
public void setMoney(double money)
money
- The money to set.public Party getParty()
public void setParty(Party party)
party
- The party to set.public double getTotalDistanceTraveled()
public void setTotalDistanceTraveled(double totalDistanceTraveled)
totalDistanceTraveled
- The totalDistanceTraveled to set.public java.lang.String getVehicleType()
public void setVehicleType(java.lang.String vehicleType)
vehicleType
- The vehicleType to set.public double getTotalTimeTaken()
public void setTotalTimeTaken(double totalTimeTaken)
totalTimeTaken
- The totalTimeTaken to set.public void addToMoney(double amount)
amount
- The amount of money to add to the vehicle's current amountpublic void subtractFromMoney(double amount)
amount
- The amount of money to subtract from the vehicle's current amountpublic void move()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |