|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.universe.DBItem | +--org.gjt.universe.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 VectorFleetID |
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 VectorPlanetID |
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 |
addStar(Star aStar)
Adds the given star to the set of those present in the system. |
void |
fleetArrived(FleetBase aFleet)
This method is called automatically by fleets when they arrive in orbit around the star system. |
void |
fleetDeparted(FleetBase aFleet)
This method is called automatically by fleets when they depart orbit around the star 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. |
VectorFleetID |
getFleetsInOrbit()
This method returns the IDs of all fleets currently directly orbiting the star system. |
VectorFleetID |
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. |
(package private) static SystemID |
getID(java.lang.String in_name)
Class meethod returns the ID of the system with the given name. |
Index |
getIndex()
Simply calls getID(). |
Location |
getLocation()
Returns the location (i.e. |
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. |
VectorPlanetID |
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 |
insertPlanet(PlanetID PID)
Adds a new planet with the given ID to the system instance. |
void |
insertWormholeID(WormholeID wid)
Adds the wormhole with the given ID to those present 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 |
removeWormholeID(WormholeID wid)
Removes the wormhole with the given ID from those present in the star system. |
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 org.gjt.universe.DBItem |
specificDisplayDebug |
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 VectorPlanetID SystemPlanets
private SimpleAccrete.StarMakeup starMakeup
private CivID owner
private java.util.Vector myWormholeIDs
private VectorFleetID 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()
static SystemID getID(java.lang.String in_name)
HACK: This currently does a brute force search. A hashtable might be warranted here if this is called often and performance is an issue.
public java.lang.String getName()
getName
in class DBItem
public void setName(java.lang.String newName)
public Location getLocation()
getLocation
in class DBItem
public CivID getOwner()
getOwner
in class DBItem
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 VectorPlanetID getSystemPlanets()
public void insertPlanet(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 void insertWormholeID(WormholeID wid)
wid
- The unique ID of wormhole being added to the star system.public void removeWormholeID(WormholeID wid)
wid
- The unique ID of wormhole being removed to the star system.public VectorFleetID getFleetsInOrbit()
getFleetsPresent
public VectorFleetID getFleetsPresent()
getFleetsInOrbit
public void fleetArrived(FleetBase aFleet)
aFleet
- The fleet which just arrived.public void fleetDeparted(FleetBase aFleet)
aFleet
- The fleet which just arrived.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |