A B C D E F G I L M N P Q R S T U V W

A

add(Cargo) - Method in class Inventory
Adds the cargo passed to the inventory and returns true if the addition was successful, false if not (there is no space in the inventory for it)
addCargo(Cargo) - Method in class Inventory
There was some confusion over whether to name the method add() or addCargo(), so this method does the exact same thing as the add() method
addToMoney(double) - Method in class Vehicle
Increases the vehcile's (player's) money by the amount passed
advanceTurn() - Static method in class Game
 
amount - Variable in class Cargo
The number of units of this cargo
appearance - Variable in class Location
The appearance of this Location -- 'sunny', 'boring', etc.
appearances - Static variable in class Descriptions
The list of possible descriptions
AVAILABLE - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'available' to see what is available to buy at the current market.

B

BUY - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'buy' to buy cargo at the current market.
buyItem(Vehicle) - Method in class Market
Finds the item the vehicle(player) wants to buy in the market's inventory, checks if the player has enough money to buy the item, if so removes it from the market's inventory, adds it to the vehicle's inventory and subtracts the cost from the vechicle's (player's) money.

C

Cargo - Class in <Unnamed>
This class represents the cargo within our game.
Cargo() - Constructor for class Cargo
The default constructor,it creates default cargo by initializing the type, amount, and the cost to random values
cargo - Variable in class Inventory
The array of Cargo objects
cargoCostFactors - Static variable in class Descriptions
The cost factors for the corresponding cargo types
cargoTypes - Static variable in class Descriptions
The types of cargo that can be traded at each market
cost - Variable in class Cargo
The base price of the cargo
createUniqueInventory(int) - Method in class Market
Creates a unique inventory for this market by creating 'size' different and new cargo items and adding them to the inventory.

D

DEFAULT_FUEL_BURN_RATE - Static variable in class Game
 
DEFAULT_INITIAL_FUEL - Static variable in class Game
 
DEFAULT_INITIAL_MONEY - Static variable in class Game
 
DEFAULT_INVENTORY_SIZE - Static variable in class Game
 
density - Variable in class Universe
The density of the universe.
Descriptions - Class in <Unnamed>
This class allows for the random generation of words for the game: location name ('Ariel', 'Hera', etc.), cargo types ('Cargo', 'Silver', etc.).
Descriptions() - Constructor for class Descriptions
The default constructor, it creates a Descriptions object.
DO_NOT_UNDERSTAND - Static variable in class Parser
The value that Parser.parse() returns if it did not understand what the user entered.

E

enterMarket(Vehicle) - Method in class Market
The main method for doing an action at a market.
EXIT_MARKET - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'exit' to exit the market and return to the location.

F

findLocationByName(String) - Method in class Universe
Finds and returns the location specified by the location name passed
fuel - Variable in class Vehicle
The amount of fuel the Vehicle has
fuelBurnRate - Variable in class Vehicle
How fast this Vehicle burns fuel
fuelUnits - Variable in class Vehicle
The units of fuel -- 'gallons', 'liters', etc.

G

Game - Class in <Unnamed>
This class contains the main method used to run the game.
Game() - Constructor for class Game
 
get(int) - Method in class Inventory
There was some confusion over whether to name the method get() or getCargo(), so this method does the exact same thing as the getCargo() method
getAmount() - Method in class Cargo
Get the Amount value.
getAppearance() - Static method in class Descriptions
Returns random appearance ('sunny', 'wet', etc.)
getAppearance() - Method in class Location
Get the Appearance value.
getCargo() - Method in class Inventory
Get the Cargo value.
getCargo(int) - Method in class Inventory
Returns the cargo found in the inventory at the position specified
getCargoCostFactor(String) - Static method in class Descriptions
Returns the cost factor for the cargo specified
getCargoType() - Static method in class Descriptions
Returns random cargo type ('gold', 'silver', etc.).
getCargoTypeCount() - Static method in class Descriptions
Returns the number of possible cargo types
getCost() - Method in class Cargo
Get the Cost value.
getDensity() - Method in class Universe
Get the Density value.
getDestination() - Static method in class Parser
This method asks the user to enter the name of the location to travel to, having indicated that he/she wants to travel to a new location
getDistance(Location) - Method in class Location
Calculates and returns the distance between this location and the one passed
getFuel() - Method in class Vehicle
Get the Fuel value.
getFuelBurnRate() - Method in class Vehicle
Get the FuelBurnRate value.
getFuelUnits() - Method in class Vehicle
Get the FuelUnits value.
getInventory() - Method in class Market
Get the Inventory value.
getInventory() - Method in class Vehicle
Get the Inventory value.
getItemToTrade(Inventory, double) - Static method in class Parser
This method asks the user to enter the number corresponding to the items he/she wants to trade
getLocation() - Method in class Vehicle
Get the Location value.
getLocationAt(int, int) - Method in class Universe
Gets the location at the position specified by the int values passed
getLocationName() - Static method in class Descriptions
Returns random location name ('Ariel', 'Hera', etc.).
getLocationNameCount() - Static method in class Descriptions
Returns the number of possible location names
getMarket() - Method in class Location
Get the Market value.
getMarketCostFactor() - Method in class Market
Get the MarketCostFactor value.
getMoney() - Method in class Vehicle
Get the Money value.
getName() - Method in class Location
Get the Name value.
getNumberCargos() - Method in class Inventory
Returns the number of cargo in the inventory
getNumCols() - Method in class Universe
Returns the width of the Universe
getNumRows() - Method in class Universe
Returns the height of the Universe
getPosX() - Method in class Location
Get the PosX value.
getPosY() - Method in class Location
Get the PosY value.
getRandomLocation() - Method in class Universe
Randomly chooses a location to return
getTotalDistanceTraveled() - Method in class Vehicle
Get the TotalDistanceTraveled value.
getTotalPrice(double) - Method in class Cargo
Returns the total price of the cargo.
getType() - Method in class Cargo
Get the Type value.
getUniverse() - Static method in class Game
Gets the universe for the game
getUniverse() - Method in class Universe
Get the Universe value.
getVehicleType() - Method in class Vehicle
Get the VehicleType value.

I

Inventory - Class in <Unnamed>
This class represents the inventory of a ve or a vehicle or a market in our game.
Inventory() - Constructor for class Inventory
The default constructor, creates an inventory of size equal to the maximum inventory size
Inventory(int) - Constructor for class Inventory
The specific constructor, creates an inventory with size equal to the value passed
inventory - Variable in class Market
The inventory of this Market
INVENTORY - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'inventory' to display his/her inventory.
inventory - Variable in class Vehicle
The Vehicle's inventory
isInInventory(String) - Method in class Inventory
Determines if the cargo type specifed is in the inventory

L

Location - Class in <Unnamed>
This class represents a Solar System within our game
Location() - Constructor for class Location
This constructor creates a default location with some set of initial values
Location(String, String, double, double) - Constructor for class Location
This constructor creates a location according to the passed values and leaves the market as null
Location(String, String, double, double, Market) - Constructor for class Location
This constructor creates a location according to the passed values
location - Variable in class Vehicle
The Vehicle's current location
locationNames - Static variable in class Descriptions
The possible location names for each location

M

main(String[]) - Static method in class Game
 
Map - Class in <Unnamed>
 
Map() - Constructor for class Map
 
market - Variable in class Location
The Location's market
Market - Class in <Unnamed>
 
Market(double) - Constructor for class Market
The specific constructor.
MARKET - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'market' to enter the market at teh current location.
marketCostFactor - Variable in class Market
The cost factor for this market -- how expensive things are here
MAX_CARGO_AMT - Static variable in class Game
 
MAX_CARGO_PRICE - Static variable in class Game
 
MAX_COST_FACTOR - Static variable in class Game
 
MAX_INVENTORY_SIZE - Static variable in class Game
 
money - Variable in class Vehicle
How much money the Vehicle (i.e.

N

name - Variable in class Location
The name of this Location

P

parse() - Static method in class Parser
This method reads in the user's input from the keyboard, and returns a value corresponding to what the user entered.
Parser - Class in <Unnamed>
This class is used to get commands as user input from the keyboard.
Parser() - Constructor for class Parser
Making the constructor private prevents anybody from calling it (as we don't want to create objects of this class
populate() - Method in class Universe
Creates different and new locations, and place at positions in the universe depending on the universe density
posX - Variable in class Location
x pos of location in 2d array universe
posY - Variable in class Location
y pos of location in 2d array universe
printGrid(Universe) - Static method in class Map
This method prints the universe grid, labelling each location with a number.
printInventory() - Method in class Inventory
Prints the contents of the inventory
printInventory() - Method in class Market
Prints the contents of the inventory
printInventoryWithNumbers(double) - Method in class Inventory
Prints the contents of the inventory specifying the amount of each type of cargo and the cost for each type of cargo
printLocationCommands() - Method in class Vehicle
Prints the commands available for the location to the screen
printLocations(Universe, Vehicle) - Static method in class Map
This method prints all the locations in the current Universe, indicating the player's current location as well.
printMap(Vehicle) - Static method in class Map
This method prints the position of each location in the universe, and the position of the player in the Universe (i.e.
printMarketCommands() - Method in class Market
Prints the commands available to the player when in the market to the screen

Q

QUIT - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'quit' to quit the game.

R

rand - Static variable in class Game
 
remove(int) - Method in class Inventory
There was some confusion over whether to name the method remove() or removeCargo(), so this method does the exact same thing as the removeCargo() method
removeCargo(int) - Method in class Inventory
Removes and returns the cargo at the specified position from the inventory (adjusting the positions of the remaining cargo as necessary)
ROTATION_FACTOR_DEGREES - Static variable in class Game
 

S

SELL - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'sell' sell cargo at the current market.
sellItem(Vehicle) - Method in class Market
Finds the item the vehicle(player) wants to sell in its inventory, removes it from the vehicle's inventory, adds it to the market's inventory and adds the cost to the vechicle's (player's) money.
setAmount(int) - Method in class Cargo
Set the Amount value.
setAppearance(String) - Method in class Location
Set the Appearance value.
setCargo(Cargo[]) - Method in class Inventory
Set the Cargo value.
setCost(double) - Method in class Cargo
Set the Cost value.
setDensity(double) - Method in class Universe
Set the Density value.
setFuel(double) - Method in class Vehicle
Set the Fuel value.
setFuelBurnRate(double) - Method in class Vehicle
Set the FuelBurnRate value.
setFuelUnits(String) - Method in class Vehicle
Set the FuelUnits value.
setInventory(Inventory) - Method in class Market
Set the Inventory value.
setInventory(Inventory) - Method in class Vehicle
Set the Inventory value.
setLocation(Location) - Method in class Vehicle
Set the Location value.
setLocationAt(int, int, Location) - Method in class Universe
Sets the location at the specified coordinates to the passed value
setMarket(Market) - Method in class Location
Set the Market value.
setMarketCostFactor(double) - Method in class Market
Set the MarketCostFactor value.
setMoney(double) - Method in class Vehicle
Set the Money value.
setName(String) - Method in class Location
Set the Name value.
setPosX(double) - Method in class Location
Set the PosX value.
setPosY(double) - Method in class Location
Set the PosY value.
setTotalDistanceTraveled(double) - Method in class Vehicle
Set the TotalDistanceTraveled value.
setType(String) - Method in class Cargo
Set the Type value.
setUniverse(Location[][]) - Method in class Universe
Set the Universe value.
setVehicleType(String) - Method in class Vehicle
Set the VehicleType value.
stdin - Static variable in class Parser
The Scanner object that is used by the various Parser methods
style - Static variable in class Game
 
subtractFromMoney(double) - Method in class Vehicle
Decreases the vehcile's (player's) money by the amount passed

T

takeTurn() - Method in class Vehicle
The is the primary method for doing an action at a location.
toString() - Method in class Cargo
Returns the cargo represented as a String
toString() - Method in class Inventory
Returns a String representation of the contents of the inventory
toString() - Method in class Location
Returns a String representation of the location (its name)
totalDistanceTraveled - Variable in class Vehicle
The Vehicle's odometer -- how far it has traveled
TRAVEL - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'travel' to travel to another location in the universe.
travelToLocation(Location) - Method in class Vehicle
The method to travel to the location specified.
type - Variable in class Cargo
The type of the cargo: 'gold', 'silver', 'Java textbooks', etc.

U

universe - Static variable in class Game
 
Universe - Class in <Unnamed>
This class creates a universe of locations
Universe(int, int, double) - Constructor for class Universe
The specific constructor, in initializes the fields to the passed values.
Universe() - Constructor for class Universe
The default constructor, it initializes the Universe to default values.
universe - Variable in class Universe
The 2d array of locations in the universe, indexed by row-col coordinates.
UNIVERSE_DENSITY - Static variable in class Game
 
UNIVERSE_HEIGHT - Static variable in class Game
 
UNIVERSE_WIDTH - Static variable in class Game
 

V

Vehicle - Class in <Unnamed>
This class represents a Vehicle (player) within our game.
Vehicle() - Constructor for class Vehicle
The default constructor, it initializes the Vehicle to some default values
Vehicle(String, Location, Inventory, double, String, double, double, double) - Constructor for class Vehicle
The specific constructor, it initializes the eight fields of this object.
vehicleType - Variable in class Vehicle
The name of the vehicle: 'golfcart', 'Serenity', etc.

W

WORLDMAP - Static variable in class Parser
The value that Parser.parse() returns if the user enters 'worldmap' to print the map of the universe.

A B C D E F G I L M N P Q R S T U V W