org.gjt.universe
Class GalaxyGlobular
java.lang.Object
|
+--org.gjt.universe.DBItem
|
+--org.gjt.universe.GalaxyBase
|
+--org.gjt.universe.GalaxyStd
|
+--org.gjt.universe.GalaxyGlobular
- All Implemented Interfaces:
- java.io.Serializable
- public class GalaxyGlobular
- extends GalaxyStd
- implements java.io.Serializable
This class implements instances of randomly generated
globular galaxies. This type of galaxy has not yet
congealed into an elliptical or spiral galaxy and
is thus a loose conglomeration of small clusters of
stars. This type of galaxy is good for small to medium
scale games. The fact that the stars are collected
into little islands usually should present some
good strategic "island-hopping" situations.
- Author:
- Allan Noordvyk (noordvyk@home.com)
- See Also:
GalaxyElliptical
,
GalaxySpiral
,
Serialized Form
Nested Class Summary |
private class |
GalaxyGlobular.GlobularCluster
This internal class is used to encapsulate
a globular cluster inside globular galaxy. |
Fields inherited from class org.gjt.universe.GalaxyBase |
|
Constructor Summary |
GalaxyGlobular(float width,
float height,
float depth,
float density)
This is the designated constructor which should be used to
create instances of this class. |
Method Summary |
Coord |
newSystemCoord()
This method returns a coordinate for a new system. |
int |
starSystemCount()
This method has been overridden to compute the number
of stars necessary for the clusters within this galaxy
to have the desired average density (i.e. |
java.lang.String |
structureDescription()
This method overrides that of our superclass to return
"Globular". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DESCRIPTION
public static java.lang.String DESCRIPTION
myClusters
private java.util.Vector myClusters
ourFillRatio
private float ourFillRatio
GalaxyGlobular
public GalaxyGlobular(float width,
float height,
float depth,
float density)
- This is the designated constructor which should be used to
create instances of this class.
- Parameters:
width
- The width of the galaxy (in parsecs)height
- The height of the galaxy (in parsecs)depth
- The depth of the galaxy (in parsecs)density
- The average density (in systems per cubic parsec) of stars within the hull of the galaxy (not its bounding cube).
structureDescription
public java.lang.String structureDescription()
- This method overrides that of our superclass to return
"Globular".
- Overrides:
structureDescription
in class GalaxyStd
starSystemCount
public int starSystemCount()
- This method has been overridden to compute the number
of stars necessary for the clusters within this galaxy
to have the desired average density (i.e. the space
outside of clusters is ignored).
- Overrides:
starSystemCount
in class GalaxyStd
- Returns:
- Number of star systems that will exist in the completed galaxy.
newSystemCoord
public Coord newSystemCoord()
- This method returns a coordinate for a new system.
It randomly selects one of the clusters previously
defined and then finds an unoccupied coordinate
somewhere in the vicinity.
- Overrides:
newSystemCoord
in class GalaxyStd
- Returns:
- Randomly selected unoccupied coordinate in a randomly selected cluster.
- See Also:
#containsCoord()
Copyright © 2001 Universe Dev Team All Rights Reserved.