org.gjt.universe
Class GameOptions

java.lang.Object
  |
  +--org.gjt.universe.GameOptions
All Implemented Interfaces:
java.io.Serializable

public class GameOptions
extends java.lang.Object
implements java.io.Serializable

This class implements an object which contains the game options which may be set by the creating civ.

Version:
$Id: GameOptions.java,v 1.9 2001/07/01 06:53:25 noordvyk Exp $
See Also:
Serialized Form

Field Summary
private  float[] accrete_distribution
           
private  java.util.Vector civOptionsList
           
private  boolean gameLoaded
           
private  GameScale gameScale
           
private  java.lang.String internal_FileName
           
private  int internal_scheme
           
private  boolean internal_shouldCreateNewUniverse
           
private  java.lang.String internal_TechnologyFileName
           
private  int internal_theme
           
private  SchemeBase scheme_object
           
private  int theme_version
           
private  float wormhole_oscillation_probability
           
private  float wormhole_probability
           
private  float wormhole_stability_probability
           
 
Constructor Summary
GameOptions()
          The designated constructor for this class.
 
Method Summary
 void addCivilization(CivOptions newValue)
          Adds a starting civilization described in the given options object to those that will be in the game.
 void FileName(java.lang.String str)
           
 float[] getAccreteHistogram()
           
 int getCivilizationCount()
          Returns the number of starting civlizations in the game.
 java.util.Vector getCivilizations()
          Returns the list of CivOptions objects for the starting civilizations in the game.
 java.lang.String getFileName()
           
 GameScale getGameScale()
          This method returns the game scale value contained in the game options.
 int getScheme()
           
 SchemeBase getSchemeObject()
           
 java.lang.String getSchemeString()
           
 boolean getShouldCreateNewUniverse()
           
 java.lang.String getTechnologyFileName()
           
 int getTheme()
           
 java.lang.String getThemeString()
           
 int getThemeVersion()
           
 float getWormholeOscillationProbability()
          This method returns the probability (0.0 to 1.0) that a naturally occuring wormhole will be oscillating.
 float getWormholeProbability()
          This method returns the average probability (0.0 to 1.0) that a naturally occuring wormhole will be present in a star system at the start of a game.
 float getWormholeStabilityProbability()
          This method returns the probability (0.0 to 1.0) that a naturally occuring wormhole is stable.
 boolean isLoadGame()
           
 void loadGame()
           
 void resetCivilizations()
          This method resets the list of starting civilizations to be empty.
 void saveToConfig()
          This method causes the game options object to persistently save its current values to the game configuration file so that they will be used the next time the game is run.
 void setAccreteHistogram(float[] values)
           
 void setGameScale(GameScale gs)
          This method sets the game scale value to be contained in the game options.
 void setScheme(int scheme)
          This method sets the scheme which should be used in the game.
 void setShouldCreateNewUniverse(boolean bool_in)
           
 void setTheme(int theme)
           
 void setThemeVersion(int version)
           
 void setWormholeOscillationProbability(float newValue)
          This method sets the probability (0.0 to 1.0) that a naturally occuring wormhole will be oscillating.
 void setWormholeProbability(float newValue)
          This method sets the average probability (0.0 to 1.0) that a naturally occuring wormhole will be present in a star system at the start of a game.
 void setWormholeStabilityProbability(float newValue)
          This method sets the probability (0.0 to 1.0) that a naturally occuring wormhole is stable.
 void TechnologyFileName(java.lang.String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gameLoaded

private boolean gameLoaded

civOptionsList

private java.util.Vector civOptionsList

internal_shouldCreateNewUniverse

private boolean internal_shouldCreateNewUniverse

gameScale

private GameScale gameScale

internal_FileName

private java.lang.String internal_FileName

internal_TechnologyFileName

private java.lang.String internal_TechnologyFileName

internal_scheme

private int internal_scheme

internal_theme

private int internal_theme

theme_version

private int theme_version

scheme_object

private SchemeBase scheme_object

accrete_distribution

private float[] accrete_distribution

wormhole_probability

private float wormhole_probability

wormhole_stability_probability

private float wormhole_stability_probability

wormhole_oscillation_probability

private float wormhole_oscillation_probability
Constructor Detail

GameOptions

public GameOptions()
The designated constructor for this class. It loads any previously saved values from the game configuration file (or use suitable defaults if a particular option has not previously been saved).

Method Detail

saveToConfig

public void saveToConfig()
This method causes the game options object to persistently save its current values to the game configuration file so that they will be used the next time the game is run.


loadGame

public void loadGame()

isLoadGame

public boolean isLoadGame()

resetCivilizations

public void resetCivilizations()
This method resets the list of starting civilizations to be empty. This is normally done prior to the recreation of the list in modified form via the addCivilization() method.

See Also:
addCivilization( CivOptions newValue )

addCivilization

public void addCivilization(CivOptions newValue)
Adds a starting civilization described in the given options object to those that will be in the game.

Parameters:
newValue - The object describing the civilization's attributes.
See Also:
resetCivilizations(), getCivilizations()

getCivilizations

public java.util.Vector getCivilizations()
Returns the list of CivOptions objects for the starting civilizations in the game. This method will return an empty vector prior to the setting of a scheme, since it is needed for the starting civilizations founding species to be understood.

See Also:
addCivilization( CivOptions newValue ), setScheme( int Scheme )

getCivilizationCount

public int getCivilizationCount()
Returns the number of starting civlizations in the game. This method will return zero prior to the setting of a scheme, since it is needed for the starting civilizations founding species to be understood.


setShouldCreateNewUniverse

public void setShouldCreateNewUniverse(boolean bool_in)

getShouldCreateNewUniverse

public boolean getShouldCreateNewUniverse()

getGameScale

public GameScale getGameScale()
This method returns the game scale value contained in the game options.


setGameScale

public void setGameScale(GameScale gs)
This method sets the game scale value to be contained in the game options.


FileName

public void FileName(java.lang.String str)

getFileName

public java.lang.String getFileName()

TechnologyFileName

public void TechnologyFileName(java.lang.String str)

getTechnologyFileName

public java.lang.String getTechnologyFileName()

setScheme

public void setScheme(int scheme)
This method sets the scheme which should be used in the game. Upon acceptance of the new scheme, this method initializes it and loads the starting civilization options (this could not be done until the scheme was initialized as the founding species must be defined first by the scheme).

Parameters:
scheme - The unique ID number of the scheme to be used.

getScheme

public int getScheme()

getSchemeString

public java.lang.String getSchemeString()

getSchemeObject

public SchemeBase getSchemeObject()

setTheme

public void setTheme(int theme)

getTheme

public int getTheme()

getThemeString

public java.lang.String getThemeString()

setThemeVersion

public void setThemeVersion(int version)

getThemeVersion

public int getThemeVersion()

setAccreteHistogram

public void setAccreteHistogram(float[] values)

getAccreteHistogram

public float[] getAccreteHistogram()

setWormholeProbability

public void setWormholeProbability(float newValue)
This method sets the average probability (0.0 to 1.0) that a naturally occuring wormhole will be present in a star system at the start of a game.

Parameters:
newValue - The new probability value.

getWormholeProbability

public float getWormholeProbability()
This method returns the average probability (0.0 to 1.0) that a naturally occuring wormhole will be present in a star system at the start of a game.


setWormholeStabilityProbability

public void setWormholeStabilityProbability(float newValue)
This method sets the probability (0.0 to 1.0) that a naturally occuring wormhole is stable.

Parameters:
newValue - The new probability value.

getWormholeStabilityProbability

public float getWormholeStabilityProbability()
This method returns the probability (0.0 to 1.0) that a naturally occuring wormhole is stable.


setWormholeOscillationProbability

public void setWormholeOscillationProbability(float newValue)
This method sets the probability (0.0 to 1.0) that a naturally occuring wormhole will be oscillating.

Parameters:
newValue - The new probability value.

getWormholeOscillationProbability

public float getWormholeOscillationProbability()
This method returns the probability (0.0 to 1.0) that a naturally occuring wormhole will be oscillating.



Copyright © 2001 Universe Dev Team All Rights Reserved.