|
|||||||||||
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.SystemBase
The abstract base class from which concrete star system classes are defined. A star system contains one or more stars, and zero or more planets orbiting these stars. The system is enclosed in a single hyperlimit (i.e. the stars in the system orbit each other close enough that they represent a single end point to a hyperspace flight).
SystemStd
,
Serialized FormField Summary | |
private Coord |
coord_location
|
private static SystemID |
currentID
|
private java.util.Vector |
fleetsInOrbit
|
private GalaxyID |
GalaxyMember
|
private SystemID |
ID
|
private java.util.Vector |
myStars
|
private java.util.Vector |
myWormholeIDs
|
private java.lang.String |
name
|
private CivID |
owner
|
private SimpleAccrete.StarMakeup |
starMakeup
|
private java.util.Vector |
systemPlanets
|
Constructor Summary | |
protected |
SystemBase()
Creates a new system with a default undefined name and ID. |
protected |
SystemBase(GalaxyID in_galID,
java.lang.String in_name,
Coord in_coord,
SimpleAccrete.StarMakeup sm)
Creates a new instance of this class, containing a single star and no planets. |
Method Summary | |
void |
addPlanet(PlanetID PID)
Adds a new planet with the given ID to the system instance. |
void |
addStar(Star aStar)
Adds the given star to the set of those present in the system. |
void |
generatePlanetsForStar(SimpleAccrete.PlanetaryMakeup[] pms,
int starIndex)
Adds planets to the star with the given index in the system, based on the given planetary make-ups. |
Coord |
getCoords()
Returns the three-space coordinates of the system instance within the galaxy to which it belongs. |
java.util.Vector |
getFleetsInOrbit()
This method returns the IDs of all fleets currently directly orbiting the star system. |
java.util.Vector |
getFleetsPresent()
This method returns the IDs of all fleets currently present in the star system, regardless of the individual body within the star system which the fleet is directly orbiting. |
GalaxyID |
getGalaxy()
Returns the ID of the galaxy to which the system instance belongs |
SystemID |
getID()
Returns the unique ID assigned to the receiving system when it was created. |
Index |
getIndex()
Simply calls getID(). |
java.lang.String |
getName()
Returns the name of the receiving system. |
CivID |
getOwner()
Returns the ID of the civ who is deemed to be in control of the receiving system. |
SimpleAccrete.StarMakeup |
getStarMakeup()
Returns the stellar make-up of the primary star in the receiving system instance. |
java.util.Vector |
getStars()
|
java.util.Vector |
getSystemPlanets()
Returns the planets which are orbitting the system instance. |
java.util.Vector |
getWormholeIDs()
Returns a vector of wormhole IDs representing the wormholes with end-points in the star system. |
void |
planetChangedOwner(PlanetID aPlanetID,
CivID newPlanetOwner)
This method is called by planets in the star system when they have changed ownership. |
void |
setName(java.lang.String newName)
Sets the name of the receiving system. |
void |
setOwner(CivID newOwner)
Sets the civ who is deemed to be in control of the system instance. |
void |
setStarMakeup(SimpleAccrete.StarMakeup sm)
Sets the stellar make-up of the primary star in the receiving instance. |
Star |
starAtIndex(int index)
This method returns the star at the given index in the set of those stars present in the system. |
int |
starCount()
This method returns the number of stars present in the system. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static SystemID currentID
private SystemID ID
private java.lang.String name
private GalaxyID GalaxyMember
private Coord coord_location
private java.util.Vector myStars
private java.util.Vector systemPlanets
private SimpleAccrete.StarMakeup starMakeup
private CivID owner
private java.util.Vector myWormholeIDs
private java.util.Vector fleetsInOrbit
Constructor Detail |
protected SystemBase(GalaxyID in_galID, java.lang.String in_name, Coord in_coord, SimpleAccrete.StarMakeup sm)
in_galID
- The unique ID of the galaxy to which the system is being added.in_name
- The name which is to be shown to the user for this system.in_coord
- The coordinates of the system within its galaxy.sm
- The composition of the intial star in the system.protected SystemBase()
Method Detail |
public SystemID getID()
public Index getIndex()
getIndex
in class DBItem
getID()
public java.lang.String getName()
getName
in class DBItem
public void setName(java.lang.String newName)
public CivID getOwner()
setOwner( CivID newOwner )
,
planetChangedOwner( PlanetID aPlanetID, CivID newPlanetOwner )
public void setOwner(CivID newOwner)
public Coord getCoords()
public GalaxyID getGalaxy()
public SimpleAccrete.StarMakeup getStarMakeup()
public void setStarMakeup(SimpleAccrete.StarMakeup sm)
public int starCount()
starAtIndex
public Star starAtIndex(int index)
index
- The position of the desired star in the set of those present in the system (starting from zero).public void addStar(Star aStar)
aStar
- The star to be added as a new component of the system.public java.util.Vector getStars()
public java.util.Vector getSystemPlanets()
public void addPlanet(PlanetID PID)
PID
- The unique ID of the planet to be added.
NOTE: Check if this this method called anywhere? Maybe
from PlanetBase?public void generatePlanetsForStar(SimpleAccrete.PlanetaryMakeup[] pms, int starIndex)
pms
- Planetary make-up information for the new planets.starIndex
- Index of the star that is being populated with planets.public void planetChangedOwner(PlanetID aPlanetID, CivID newPlanetOwner)
public java.util.Vector getWormholeIDs()
public java.util.Vector getFleetsInOrbit()
getFleetsPresent
public java.util.Vector getFleetsPresent()
getFleetsInOrbit
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |