|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--universe.common.database.DBItem | +--universe.server.database.GalaxyBase
Abstract class from which all concrete classes used to represent galaxies in the game are to be derived. This class contains implementation of basic primitive methods for the storage and manipulation of standard galaxy attributes. Subclasses merely have to override the generateSystems method to ensure that star systems and their planets are created as per the nature of the galaxy (e.g. randomly determined, loaded from a data file, a combination of the above, etc.).
GalaxyStd
,
GalaxyGliese
,
Serialized FormField Summary | |
private static GalaxyID |
currentID
|
private boolean |
HasGeneratedSystems
|
private GalaxyID |
ID
|
private java.lang.String |
name
|
private java.util.Vector |
systems
|
Constructor Summary | |
(package private) |
GalaxyBase()
Designated constructor - generates unique ID for the galaxy object and adds it to the list of galaxies in the game. |
(package private) |
GalaxyBase(boolean dummy)
Constructor for GalaxyUndefined. |
Method Summary | |
void |
addSystem(SystemID SID)
Adds a System to the Galaxy |
void |
generateSystems(float[] planetDistribution)
This method should be extended by subclasses to causes the receiving galaxy to generate the collection of star systems and associated planets which it will contain. |
GalaxyID |
getID()
Return the ID |
Index |
getIndex()
|
java.lang.String |
getName()
|
java.util.Vector |
getSystems()
Returns the galaxy's system list |
boolean |
hasGeneratedSystems()
Returns true if the galaxy has been populated with star systems and their planets, and false if this has not yet been done. |
void |
setName(java.lang.String in_name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static GalaxyID currentID
private GalaxyID ID
private java.lang.String name
private java.util.Vector systems
private boolean HasGeneratedSystems
Constructor Detail |
GalaxyBase()
GalaxyBase(boolean dummy)
Method Detail |
public GalaxyID getID()
public Index getIndex()
getIndex
in class DBItem
in the subclasses for a typed version.
public java.lang.String getName()
getName
in class DBItem
public void setName(java.lang.String in_name)
public void addSystem(SystemID SID)
public java.util.Vector getSystems()
public boolean hasGeneratedSystems()
generateSystems()
public void generateSystems(float[] planetDistribution) throws SchemeUnknownException, java.lang.InterruptedException
planetDistribution
- Array of floating point values representing the probability of planetary mass at successive distances from its primary.
SchemeUnknownException
- If unable to determine a ID of the galaxy to which systems are to be added.
java.lang.InterruptedException
- If access to a resource needed for star system generation has been interrupted.hasGeneratedSystems
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |