Class Game

java.lang.Object
  extended by Game

public class Game
extends java.lang.Object

class Game is the main class


Field Summary
static int BOARD_HEIGHT
          The height of the board/map, in rows.
static int BOARD_WIDTH
          The width of the board/map, in columns.
static boolean cheatModeEnabled
          Holds whether or not cheat mode has been enabled
static int DEFAULT_AMMO_AMOUNT
          The default amount of ammo that each depot will have
static double DEFAULT_AMMO_COST
          The amount that ammo costs (not counting the price factors of depots)
static int DEFAULT_FOOD_AMOUNT
          The default amount of food that each depot will have
static double DEFAULT_FOOD_COST
          The amount that food costs (not counting the price factors of depots)
static int DEFAULT_OXEN_AMOUNT
          The default amount of oxen that each depot will have
static double DEFAULT_OXEN_COST
          The amount that oxen costs (not counting the price factors of depots)
static int DEFAULT_PARTY_SIZE
          The party size, counting the leader.
static int DEFAULT_VISIBILITY
          The number of squares, in each direction, that the player can see the terrain type (and depot status) of.
static double DENSITY_FOREST
          The density of forest squares -- the percent (out of 1) of overall squares that will be forests.
static double DENSITY_MOUNTAIN
          The density of mountain squares -- the percent (out of 1) of overall squares that will be mountains.
static double DEPOT_CHANCE
          The chance (out of 1) that a depot will occur on a given location
static int DISTANCE_BETWEEN_SQUARES
          The number of units between successive squares.
static java.lang.String DISTANCE_UNIT
          The particular unit (miles, kilometers, parsecs, etc.) that the DISTANCE_BETWEEN_SQUARES is stated in.
static int FINISH_COL_COORD
          The ending row coordinate for the game.
static int FINISH_ROW_COORD
          The ending column coordinate for the game.
static int FOOD_CONSUMPTION_RATE
          How many pounds of food each person consumes per day.
static double HEALTH_PROBLEM_CHANCE
          The chance (out of 1) that a health 'problem' will occur on a given turn.
static Map map
          The main Map object that the game uses
static int MAX_HEALTH
          The maximum (and starting) health of the people in the party.
static int MOVE_EAST
          The value returned by Parser.getMoveDirection() when the player chooses to move east.
static int MOVE_NORTH
          The value returned by Parser.getMoveDirection() when the player chooses to move north.
static int MOVE_SOUTH
          The value returned by Parser.getMoveDirection() when the player chooses to move south.
static int MOVE_WEST
          The value returned by Parser.getMoveDirection() when the player chooses to move west.
static double MOVEMENT_COST_FOREST
          How many days it takes to move through one square of each terrain type
static double MOVEMENT_COST_GRASSLAND
          How many days it takes to move through one square of each terrain type
static double MOVEMENT_COST_MOUNTAIN
          How many days it takes to move through one square of each terrain type
static double OXEN_SPEED_FACTOR
          A constant to determine how fast one can travel with oxen.
static Vehicle player
          The main Vehicle object that represents the player
static double PRICE_FACTOR_MODIFIER
          A constant to modify the price factor of depots.
static java.util.Random rand
          We mixed up whether to call it rand or random, so there are two references to the same object
static java.util.Random random
          A random number generator, it's purpose here is to ensure that there is only one Random object declared in the game
static int REST_HEALTH_RATE
          The amount of health points recovered for each day of rest.
static int START_COL_COORD
          The starting row coordinate of the player.
static int START_ROW_COORD
          The starting column coordinate of the player.
static double STARTING_MONEY
          The amount of money that the player starts with.
static int STARVATION_HEALTH_COST
          The amount of health points lost when there is not enough food.
static java.text.NumberFormat style
          A general purpose number formatter
static int TERRAIN_FOREST
          One of the five values for a terrain spot in a Location object; this indicates the location is a forest
static int TERRAIN_GRASSLAND
          One of the five values for a terrain spot in a Location object; this indicates the location is a grassland
static int TERRAIN_MOUNTAIN
          One of the five values for a terrain spot in a Location object; this indicates the location is a mountain
static int TERRAIN_UNSET
          One of the five values for a terrain spot in a Location object; unset means it has not yet been given a value
static java.lang.String TIME_UNIT
          The time unit (days, hours, etc.) -- how long travel takes is stated in this unit.
 
Constructor Summary
Game()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TERRAIN_UNSET

public static final int TERRAIN_UNSET
One of the five values for a terrain spot in a Location object; unset means it has not yet been given a value

See Also:
Constant Field Values

TERRAIN_MOUNTAIN

public static final int TERRAIN_MOUNTAIN
One of the five values for a terrain spot in a Location object; this indicates the location is a mountain

See Also:
Constant Field Values

TERRAIN_FOREST

public static final int TERRAIN_FOREST
One of the five values for a terrain spot in a Location object; this indicates the location is a forest

See Also:
Constant Field Values

TERRAIN_GRASSLAND

public static final int TERRAIN_GRASSLAND
One of the five values for a terrain spot in a Location object; this indicates the location is a grassland

See Also:
Constant Field Values

MOVEMENT_COST_MOUNTAIN

public static final double MOVEMENT_COST_MOUNTAIN
How many days it takes to move through one square of each terrain type

See Also:
Constant Field Values

MOVEMENT_COST_FOREST

public static final double MOVEMENT_COST_FOREST
How many days it takes to move through one square of each terrain type

See Also:
Constant Field Values

MOVEMENT_COST_GRASSLAND

public static final double MOVEMENT_COST_GRASSLAND
How many days it takes to move through one square of each terrain type

See Also:
Constant Field Values

DEPOT_CHANCE

public static final double DEPOT_CHANCE
The chance (out of 1) that a depot will occur on a given location

See Also:
Constant Field Values

DEFAULT_FOOD_AMOUNT

public static final int DEFAULT_FOOD_AMOUNT
The default amount of food that each depot will have

See Also:
Constant Field Values

DEFAULT_OXEN_AMOUNT

public static final int DEFAULT_OXEN_AMOUNT
The default amount of oxen that each depot will have

See Also:
Constant Field Values

DEFAULT_AMMO_AMOUNT

public static final int DEFAULT_AMMO_AMOUNT
The default amount of ammo that each depot will have

See Also:
Constant Field Values

DEFAULT_FOOD_COST

public static final double DEFAULT_FOOD_COST
The amount that food costs (not counting the price factors of depots)

See Also:
Constant Field Values

DEFAULT_OXEN_COST

public static final double DEFAULT_OXEN_COST
The amount that oxen costs (not counting the price factors of depots)

See Also:
Constant Field Values

DEFAULT_AMMO_COST

public static final double DEFAULT_AMMO_COST
The amount that ammo costs (not counting the price factors of depots)

See Also:
Constant Field Values

DENSITY_FOREST

public static final double DENSITY_FOREST
The density of forest squares -- the percent (out of 1) of overall squares that will be forests. Forests and mountains are placed first, then the remaining squares are grassland.

See Also:
Constant Field Values

DENSITY_MOUNTAIN

public static final double DENSITY_MOUNTAIN
The density of mountain squares -- the percent (out of 1) of overall squares that will be mountains. Forests and mountains are placed first, then the remaining squares are grassland.

See Also:
Constant Field Values

BOARD_WIDTH

public static final int BOARD_WIDTH
The width of the board/map, in columns.

See Also:
Constant Field Values

BOARD_HEIGHT

public static final int BOARD_HEIGHT
The height of the board/map, in rows.

See Also:
Constant Field Values

START_COL_COORD

public static final int START_COL_COORD
The starting row coordinate of the player. It will automatically have a depot.

See Also:
Constant Field Values

START_ROW_COORD

public static final int START_ROW_COORD
The starting column coordinate of the player. It will automatically have a depot.

See Also:
Constant Field Values

FINISH_ROW_COORD

public static final int FINISH_ROW_COORD
The ending column coordinate for the game.

See Also:
Constant Field Values

FINISH_COL_COORD

public static final int FINISH_COL_COORD
The ending row coordinate for the game.

See Also:
Constant Field Values

MOVE_NORTH

public static final int MOVE_NORTH
The value returned by Parser.getMoveDirection() when the player chooses to move north.

See Also:
Constant Field Values

MOVE_SOUTH

public static final int MOVE_SOUTH
The value returned by Parser.getMoveDirection() when the player chooses to move south.

See Also:
Constant Field Values

MOVE_EAST

public static final int MOVE_EAST
The value returned by Parser.getMoveDirection() when the player chooses to move east.

See Also:
Constant Field Values

MOVE_WEST

public static final int MOVE_WEST
The value returned by Parser.getMoveDirection() when the player chooses to move west.

See Also:
Constant Field Values

STARTING_MONEY

public static final double STARTING_MONEY
The amount of money that the player starts with.

See Also:
Constant Field Values

DEFAULT_VISIBILITY

public static final int DEFAULT_VISIBILITY
The number of squares, in each direction, that the player can see the terrain type (and depot status) of.

See Also:
Constant Field Values

DEFAULT_PARTY_SIZE

public static final int DEFAULT_PARTY_SIZE
The party size, counting the leader.

See Also:
Constant Field Values

PRICE_FACTOR_MODIFIER

public static final double PRICE_FACTOR_MODIFIER
A constant to modify the price factor of depots. This is computed by dividing the distance from the starting location to the depot, and then dividing by this amount.

See Also:
Constant Field Values

MAX_HEALTH

public static final int MAX_HEALTH
The maximum (and starting) health of the people in the party.

See Also:
Constant Field Values

REST_HEALTH_RATE

public static final int REST_HEALTH_RATE
The amount of health points recovered for each day of rest.

See Also:
Constant Field Values

HEALTH_PROBLEM_CHANCE

public static final double HEALTH_PROBLEM_CHANCE
The chance (out of 1) that a health 'problem' will occur on a given turn.

See Also:
Constant Field Values

OXEN_SPEED_FACTOR

public static final double OXEN_SPEED_FACTOR
A constant to determine how fast one can travel with oxen. With 1/OXEN_SPEEND_FACTOR oxen, it will take as many days to move through a terrain type as the MOVEMENT_COST_* constant.

See Also:
Constant Field Values

FOOD_CONSUMPTION_RATE

public static final int FOOD_CONSUMPTION_RATE
How many pounds of food each person consumes per day.

See Also:
Constant Field Values

STARVATION_HEALTH_COST

public static final int STARVATION_HEALTH_COST
The amount of health points lost when there is not enough food.

See Also:
Constant Field Values

DISTANCE_BETWEEN_SQUARES

public static final int DISTANCE_BETWEEN_SQUARES
The number of units between successive squares.

See Also:
Constant Field Values

DISTANCE_UNIT

public static final java.lang.String DISTANCE_UNIT
The particular unit (miles, kilometers, parsecs, etc.) that the DISTANCE_BETWEEN_SQUARES is stated in.

See Also:
Constant Field Values

TIME_UNIT

public static final java.lang.String TIME_UNIT
The time unit (days, hours, etc.) -- how long travel takes is stated in this unit.

See Also:
Constant Field Values

map

public static Map map
The main Map object that the game uses


player

public static Vehicle player
The main Vehicle object that represents the player


random

public static final java.util.Random random
A random number generator, it's purpose here is to ensure that there is only one Random object declared in the game


rand

public static final java.util.Random rand
We mixed up whether to call it rand or random, so there are two references to the same object


cheatModeEnabled

public static boolean cheatModeEnabled
Holds whether or not cheat mode has been enabled


style

public static java.text.NumberFormat style
A general purpose number formatter

Constructor Detail

Game

public Game()
Method Detail

main

public static void main(java.lang.String[] args)