org.gjt.universe
Class Civ

java.lang.Object
  |
  +--org.gjt.universe.DBItem
        |
        +--org.gjt.universe.Civ
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CivUndefined

public class Civ
extends DBItem

See Also:
Serialized Form

Field Summary
private  KnowledgeAlienMap aliens
           
private static CivID currentID
           
private  int fleetNumber
           
private  KnowledgeFleetMap fleets
           
private  RaceBase foundingSpecies
           
private  java.util.Hashtable globalResourceGroups
           
private  PlanetID HomePlanet
           
private  SystemID HomeSystem
           
private  CivID ID
           
private  KnowledgeModuleDesignMap moduledesigns
           
private  java.lang.String name
           
private static java.lang.String[] nameSuffixes
           
private  KnowledgePlanetMap planets
           
private  PlayerBase player
           
(package private)  java.util.Vector resourceGroups
          List of ResourceGroups that the civ has
 ResultList Results
          This object is for submittal of orders.
private  KnowledgeShipDesignMap shipdesigns
           
private  int shipNumber
           
private  KnowledgeShipMap ships
           
private  KnowledgeStationMap stations
           
private  KnowledgeSystemMap systems
           
private  KnowledgeTechMap techs
           
private static java.util.Hashtable usedNameTable
           
 
Constructor Summary
protected Civ(boolean undefined)
          This constructor is only for the CivUndefined object.
  Civ(CivOptions civOptions)
          This is the designated initializer used for constructing instances of this class.
 
Method Summary
 void addFleet(FleetID FID)
           
 void addResourceGroup(ResourceGroup RG)
           
 void addShip(ShipID HID)
           
 void addShipDesign(ShipDesignID DID)
           
 void addToGlobalResourceGroup(Orderable newMember)
           
 void deleteResourceGroup(ResourceGroup RG)
           
 VectorFleetID getAllFleets()
          Returns all known fleets by the civ.
 VectorFleetID getAllFleets(int age)
          Returns all known Fleets by the civ.
 VectorPlanetID getAllPlanets()
           
 VectorShipDesignID getAllShipDesigns()
           
 VectorShipID getAllShips()
           
 VectorStationID getAllStations()
           
 VectorPlanetID getExploredPlanets()
           
 VectorSystemID getExploredSystems()
           
 PlanetID getHomePlanet()
           
 SystemID getHomeSystem()
           
 CivID getID()
           
 Index getIndex()
          See getID() in the subclasses for a typed version.
 KnowledgeAlienMap getKnowledgeAlienMap()
           
 KnowledgeFleetMap getKnowledgeFleetMap()
           
 KnowledgeModuleDesignMap getKnowledgeModuleDesignMap()
           
 KnowledgePlanetMap getKnowledgePlanetMap()
           
 KnowledgeShipDesignMap getKnowledgeShipDesignMap()
           
 KnowledgeShipMap getKnowledgeShipMap()
           
 KnowledgeStationMap getKnowledgeStationMap()
           
 KnowledgeSystemMap getKnowledgeSystemMap()
           
 KnowledgeTechMap getKnowledgeTechMap()
           
 java.lang.String getName()
          This method returns the name of the civilization that should be shown in the user interface, generating one if one has not already been assigned.
(package private)  int getNextFleetNumber()
           
(package private)  int getNextShipNumber()
           
 VectorPlanetID getOccupiedPlanets()
           
 VectorStationID getOccupiedStations()
           
 VectorSystemID getOccupiedSystems()
           
 VectorFleetID getOwnedFleets()
          Returns all fleets owned by the civ.
 VectorModuleDesignID getOwnedModuleDesigns()
          Returns all known Modules by the civ.
 VectorShipDesignID getOwnedShipDesigns()
           
 VectorShipID getOwnedShips()
           
 VectorTechID getOwnedTechs()
          Returns all known Techs by the civ.
 CivID getOwner()
           
 PlayerBase getPlayer()
          This method returns the player who is directing this civilziation.
 RaceBase getRace()
           
 VectorTechID getResearchableTechs()
          Returns all Techs that are researchable by the civ.
 java.util.Vector getResourceGroups()
          Method to get all RGs
 java.util.Vector getResourceGroups(java.lang.Class UOC)
          Method to get all RGs with a specific User Object Class
 VectorSystemID getUnexploredSystems()
           
 void removeFromGlobalResourceGroup(Orderable newMember)
           
(package private)  void setHomePlanet(PlanetID PID)
          This method sets the given planet to be the home planet of the receiving instance.
(package private)  void setHomeSystem(SystemID SID)
           
 void setName(java.lang.String newValue)
          This method adopts the given value as the new name of the civilization.
 void setPlayer(PlayerBase newValue)
          This method sets the player who is directing this civilization.
 void setRace(RaceBase newValue)
           
 VectorDisplayReturn specificDisplayDebug()
          Returns a display vector used for showing debug information.
private  void updateName()
          This method is called when a civilization does not yet have a name or has changed some attribute which might affect its choice of name (e.g.
 
Methods inherited from class org.gjt.universe.DBItem
getLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentID

private static CivID currentID

nameSuffixes

private static java.lang.String[] nameSuffixes

usedNameTable

private static java.util.Hashtable usedNameTable

ID

private CivID ID

systems

private KnowledgeSystemMap systems

planets

private KnowledgePlanetMap planets

stations

private KnowledgeStationMap stations

shipdesigns

private KnowledgeShipDesignMap shipdesigns

ships

private KnowledgeShipMap ships

fleets

private KnowledgeFleetMap fleets

moduledesigns

private KnowledgeModuleDesignMap moduledesigns

techs

private KnowledgeTechMap techs

aliens

private KnowledgeAlienMap aliens

HomeSystem

private SystemID HomeSystem

HomePlanet

private PlanetID HomePlanet

name

private java.lang.String name

Results

public ResultList Results
This object is for submittal of orders.


resourceGroups

java.util.Vector resourceGroups
List of ResourceGroups that the civ has


foundingSpecies

private RaceBase foundingSpecies

player

private PlayerBase player

globalResourceGroups

private java.util.Hashtable globalResourceGroups

fleetNumber

private int fleetNumber

shipNumber

private int shipNumber
Constructor Detail

Civ

public Civ(CivOptions civOptions)
This is the designated initializer used for constructing instances of this class. The attributes of the civilization will depend upon the values in the passed CivOptions object. A new player instance of the appropriate type will be created to direct the civilization.

Parameters:
civOptions - An object containing the game start options to be used to define the civlization.

Civ

protected Civ(boolean undefined)
This constructor is only for the CivUndefined object.

Method Detail

updateName

private void updateName()
This method is called when a civilization does not yet have a name or has changed some attribute which might affect its choice of name (e.g. type of government, homeworld, etc.). This method generates a new name for the civilization, ensuring that we don't use one already in use by a different civilization.


getResourceGroups

public java.util.Vector getResourceGroups()
Method to get all RGs


getResourceGroups

public java.util.Vector getResourceGroups(java.lang.Class UOC)
Method to get all RGs with a specific User Object Class


addResourceGroup

public void addResourceGroup(ResourceGroup RG)

deleteResourceGroup

public void deleteResourceGroup(ResourceGroup RG)

addToGlobalResourceGroup

public void addToGlobalResourceGroup(Orderable newMember)

removeFromGlobalResourceGroup

public void removeFromGlobalResourceGroup(Orderable newMember)

getNextFleetNumber

int getNextFleetNumber()

getNextShipNumber

int getNextShipNumber()

getKnowledgeSystemMap

public KnowledgeSystemMap getKnowledgeSystemMap()

getKnowledgePlanetMap

public KnowledgePlanetMap getKnowledgePlanetMap()

getKnowledgeStationMap

public KnowledgeStationMap getKnowledgeStationMap()

getKnowledgeShipDesignMap

public KnowledgeShipDesignMap getKnowledgeShipDesignMap()

getKnowledgeShipMap

public KnowledgeShipMap getKnowledgeShipMap()

getKnowledgeFleetMap

public KnowledgeFleetMap getKnowledgeFleetMap()

getKnowledgeModuleDesignMap

public KnowledgeModuleDesignMap getKnowledgeModuleDesignMap()

getKnowledgeTechMap

public KnowledgeTechMap getKnowledgeTechMap()

getKnowledgeAlienMap

public KnowledgeAlienMap getKnowledgeAlienMap()

getOccupiedSystems

public VectorSystemID getOccupiedSystems()

getExploredSystems

public VectorSystemID getExploredSystems()

getUnexploredSystems

public VectorSystemID getUnexploredSystems()

getOccupiedPlanets

public VectorPlanetID getOccupiedPlanets()

getExploredPlanets

public VectorPlanetID getExploredPlanets()

getAllPlanets

public VectorPlanetID getAllPlanets()

getOccupiedStations

public VectorStationID getOccupiedStations()

getAllStations

public VectorStationID getAllStations()

getOwnedShipDesigns

public VectorShipDesignID getOwnedShipDesigns()

getAllShipDesigns

public VectorShipDesignID getAllShipDesigns()

getOwnedShips

public VectorShipID getOwnedShips()

getAllShips

public VectorShipID getAllShips()

getOwnedFleets

public VectorFleetID getOwnedFleets()
Returns all fleets owned by the civ.


getAllFleets

public VectorFleetID getAllFleets()
Returns all known fleets by the civ. This function will only return current sightings.

See Also:
FleetBase

getAllFleets

public VectorFleetID getAllFleets(int age)
Returns all known Fleets by the civ. This function will return all fleet signtings that are at least age turns old.

Parameters:
age - Age of oldest fleet sightings
See Also:
FleetBase

getOwnedModuleDesigns

public VectorModuleDesignID getOwnedModuleDesigns()
Returns all known Modules by the civ.

See Also:
ModuleDesignBase

getOwnedTechs

public VectorTechID getOwnedTechs()
Returns all known Techs by the civ.

See Also:
TechBase

getResearchableTechs

public VectorTechID getResearchableTechs()
Returns all Techs that are researchable by the civ.

See Also:
TechBase

getID

public CivID getID()

getIndex

public Index getIndex()
Description copied from class: DBItem
See getID() in the subclasses for a typed version.

Specified by:
getIndex in class DBItem

getOwner

public CivID getOwner()
Overrides:
getOwner in class DBItem

getHomeSystem

public SystemID getHomeSystem()

setHomeSystem

void setHomeSystem(SystemID SID)

getHomePlanet

public PlanetID getHomePlanet()

setHomePlanet

void setHomePlanet(PlanetID PID)
This method sets the given planet to be the home planet of the receiving instance. The ownership of this planet will be automatically changed to be that of the civ.

Parameters:
PID - The unique ID of the planet.

addFleet

public void addFleet(FleetID FID)

addShip

public void addShip(ShipID HID)

addShipDesign

public void addShipDesign(ShipDesignID DID)

getRace

public RaceBase getRace()

setRace

public void setRace(RaceBase newValue)

getName

public java.lang.String getName()
This method returns the name of the civilization that should be shown in the user interface, generating one if one has not already been assigned.

Specified by:
getName in class DBItem

setName

public void setName(java.lang.String newValue)
This method adopts the given value as the new name of the civilization.


getPlayer

public PlayerBase getPlayer()
This method returns the player who is directing this civilziation.


setPlayer

public void setPlayer(PlayerBase newValue)
This method sets the player who is directing this civilization.


specificDisplayDebug

public VectorDisplayReturn specificDisplayDebug()
Returns a display vector used for showing debug information.

Specified by:
specificDisplayDebug in class DBItem
Returns:
A display vector.


Copyright © 2001 Universe Dev Team All Rights Reserved.