Class Control

java.lang.Object
  extended by Control

public class Control
extends java.lang.Object

This class represents the Control within our game.


Constructor Summary
Control()
           
 
Method Summary
static void advanceTurn(double movementTime, int numOxen, boolean isMoving)
          This method updates game state.
static void possiblyEndGame()
          Currently a dummy method.
static void printLocationCommands()
          This method prints the commands available for the location to the screen.
static void takeTurn()
          This is the primary method for performing an action at a location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Control

public Control()
Method Detail

printLocationCommands

public static void printLocationCommands()
This method prints the commands available for the location to the screen. The valid, available commands are: move (move to another location) depot (enter the depot, if present) worldmap (print out the map) rest (rest for a specified number of days) check (check party's status) xcheat (enable cheat mode) quit (leave the game)


possiblyEndGame

public static void possiblyEndGame()
Currently a dummy method. Just prints that possiblyEndGame() was called. Ultimately, this method will determine if any of the game end conditions have occurred, such as reaching the finish location with any living party members. It will also print summary statistics when the game ends.


advanceTurn

public static void advanceTurn(double movementTime,
                               int numOxen,
                               boolean isMoving)
This method updates game state. It takes care of tasks like moving the Vehicle, feeding or starving the Party, checks for health problems and update health status as necessary.

Parameters:
movementTime - The amount of time to move.
numOxen - The number of propulsion items (oxen, rockets, etc.)
isMoving - boolean flag to indicate whether or not the Vehicle is moving

takeTurn

public static void takeTurn()
This is the primary method for performing an action at a location. This method reads in a command from the keyboard (via Parser.parse()), then takes the appropriate action based on that command. The possible actions include traveling to another location, entering the market at the current location, printing the vehicle's inventory, printing the map of the Universe, and quiting