Class Vehicle

java.lang.Object
  extended by Vehicle

public class Vehicle
extends java.lang.Object

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

theParty

private Party theParty
Party includes leader and other members. Default is an initially empty Party


vehicleType

private java.lang.String vehicleType
Describe the type of the vehicle. Default is ""


myLocation

private Location myLocation
The current Location of the Vehicle. Default is null.


myInventory

private Inventory myInventory
The Vehicle's inventory. Default is the default Inventory.


totalDistanceTraveled

private double totalDistanceTraveled
The Vehicle's odometer -- how far it has traveled


totalTimeTaken

private double totalTimeTaken
The total amount of trip time. This includes rest days.

Constructor Detail

Vehicle

public Vehicle()
Default Vehicle constructor


Vehicle

public Vehicle(int partySize)
Specific Vehicle constructor to create a Vehicle with a particular-sized Party

Parameters:
partySize - The size of the party to create for the Vehicle.
Method Detail

addLeader

public void addLeader(java.lang.String name)
Adds a leader to the Party by calling Party.addLeader(java.lang.String)

Parameters:
name - The name to assign to the leader.

addPartyMember

public void addPartyMember(java.lang.String name)
Adds a party member to the Party by calling Party.addPartyMember(java.lang.String)

Parameters:
name - The name to assign to the Party member.

getInventory

public Inventory getInventory()
Returns:
Returns the attribute inventory.

setInventory

public void setInventory(Inventory theInventory)
Parameters:
theInventory - The inventory to set.

getLeader

public Person getLeader()
Returns:
Returns the leader.

getLocation

public Location getLocation()
Returns:
Returns the location.

setLocation

public void setLocation(Location theLocation)
Parameters:
theLocation - The location to set.

getMoney

public double getMoney()
Returns:
Returns the money.

setMoney

public void setMoney(double money)
Parameters:
money - The money to set.

getParty

public Party getParty()
Returns:
Returns the party.

setParty

public void setParty(Party party)
Parameters:
party - The party to set.

getTotalDistanceTraveled

public double getTotalDistanceTraveled()
Returns:
Returns the totalDistanceTraveled.

setTotalDistanceTraveled

public void setTotalDistanceTraveled(double totalDistanceTraveled)
Parameters:
totalDistanceTraveled - The totalDistanceTraveled to set.

getVehicleType

public java.lang.String getVehicleType()
Returns:
Returns the vehicleType.

setVehicleType

public void setVehicleType(java.lang.String vehicleType)
Parameters:
vehicleType - The vehicleType to set.

getTotalTimeTaken

public double getTotalTimeTaken()
Returns:
Returns the totalTimeTaken.

setTotalTimeTaken

public void setTotalTimeTaken(double totalTimeTaken)
Parameters:
totalTimeTaken - The totalTimeTaken to set.

addToMoney

public void addToMoney(double amount)
Increases the vehcile's (player's) money by the amount passed

Parameters:
amount - The amount of money to add to the vehicle's current amount

subtractFromMoney

public void subtractFromMoney(double amount)
Decreases the vehicle's (player's) money by the amount passed

Parameters:
amount - The amount of money to subtract from the vehicle's current amount

move

public void move()