Class Descriptions

java.lang.Object
  extended by Descriptions

public class Descriptions
extends java.lang.Object

This class allows for the random generation of words for the game: location name ('Ariel', 'Hera', etc.), cargo types ('Cargo', 'Silver', etc.). It also contains the corresponding cost factor for the cargo types.


Field Summary
private static java.lang.String[] appearances
          The list of possible descriptions
private static double[] cargoCostFactors
          The cost factors for the corresponding cargo types
private static java.lang.String[] cargoTypes
          The types of cargo that can be traded at each market
private static java.lang.String[] locationNames
          The possible location names for each location
 
Constructor Summary
private Descriptions()
          The default constructor, it creates a Descriptions object.
 
Method Summary
static java.lang.String getAppearance()
          Returns random appearance ('sunny', 'wet', etc.)
static double getCargoCostFactor(java.lang.String cargo)
          Returns the cost factor for the cargo specified
static java.lang.String getCargoType()
          Returns random cargo type ('gold', 'silver', etc.).
static int getCargoTypeCount()
          Returns the number of possible cargo types
static java.lang.String getLocationName()
          Returns random location name ('Ariel', 'Hera', etc.).
static int getLocationNameCount()
          Returns the number of possible location names
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locationNames

private static java.lang.String[] locationNames
The possible location names for each location


cargoTypes

private static java.lang.String[] cargoTypes
The types of cargo that can be traded at each market


cargoCostFactors

private static double[] cargoCostFactors
The cost factors for the corresponding cargo types


appearances

private static java.lang.String[] appearances
The list of possible descriptions

Constructor Detail

Descriptions

private Descriptions()
The default constructor, it creates a Descriptions object.

Method Detail

getLocationName

public static java.lang.String getLocationName()
Returns random location name ('Ariel', 'Hera', etc.).

Returns:
A random location name

getCargoType

public static java.lang.String getCargoType()
Returns random cargo type ('gold', 'silver', etc.).

Returns:
A random cargo type

getAppearance

public static java.lang.String getAppearance()
Returns random appearance ('sunny', 'wet', etc.)

Returns:
A random appearance

getLocationNameCount

public static int getLocationNameCount()
Returns the number of possible location names

Returns:
an int value indicating the number of location names

getCargoTypeCount

public static int getCargoTypeCount()
Returns the number of possible cargo types

Returns:
an int value indicating the number of cargo types

getCargoCostFactor

public static double getCargoCostFactor(java.lang.String cargo)
Returns the cost factor for the cargo specified

Parameters:
cargo - a String representing a possible cargo type
Returns:
a double value indicating the corresponding cost factor for the cargo