|
|||||||||||
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.Wormhole | +--org.gjt.universe.WormholeOscillating
This class implements a special kind of wormhole which has one end-point which oscillates between two or more locations on a regular basis. By convention, the 1st end-point is the one that is fixed, and the 2nd end-point is the one which cycles through the wormhole's alternate star systems. A civilization must possess the appropriate level of hyperspace sensor technology in order to determine whether a wormhole has an oscillating end-point and, if so, the period of oscillation, number, and location of alternate end-points. Otherwise, they will simply have to discover through observation of results. Although the period of oscillation is normally regular, it may be changed randomly as the result of a hyperspace storm. Likewise, a hyperspace storm may add or remove one or more systems as alternate end-points of an oscillating wormhole. A civilization which possesses the appropriate level of hyperspace engineering technology may construct a wormhole focus, which will allow the current end point of an oscillating wormhole to be shifted whenever desired (even multiple times within the same game turn).
Wormhole
,
Serialized FormField Summary | |
private VectorSystemID |
alternateEndPointIDs
|
private int |
nextIndex
|
private int |
oscillationCountdown
|
private int |
oscillationPeriod
|
Fields inherited from class org.gjt.universe.Wormhole |
|
Constructor Summary | |
WormholeOscillating()
This constructor returns an oscillating wormhole with randomly determined attributes. |
|
WormholeOscillating(SystemID ep1,
VectorSystemID alt_eps,
float d,
boolean s,
float i,
int p)
This constructer is the desginated initializer for instances of this class, all other constructors in this class and subclasses should call this method as their first instruction. |
Method Summary | |
VectorSystemID |
alternateEndPointIDs()
This method returns the current set of alternate end-points system IDs assigned to the receiving oscillating wormhole instance. |
int |
getOsciliationPeriod()
This method returns the oscillation period of the wormhole (in game turns). |
boolean |
isAlternateEndPointID(SystemID anID)
This method is provided to allow callers to easily test is a particualr star system is one of the alternate end-points of the receiving oscillating wormhole instances. |
boolean |
isOscillating()
This method returns true if the wormhole is oscillating (i.e. |
private void |
prepareForOscillation()
This method is called by our two constructors to complete set-up for tying oscillation into the game turn. |
void |
setAlternateEndPointIDs(VectorSystemID newValue)
This method assigns a new set of alternate end-point system IDs to the receiving oscillating wormhole instance. |
void |
setOscillationPeriod(int newValue)
This method sets the oscillation period of the wormhole (in game turns). |
VectorDisplayReturn |
specificDisplayDebug()
This method is used for debugging purposes and returns a display vector describing this object. |
void |
turnProcessed()
This method is called automatically at the end of each game turn. |
Methods inherited from class org.gjt.universe.Wormhole |
getDiameter, getEndPoint1, getEndPoint2, getEndPointID1, getEndPointID2, getID, getIndex, getIntegrity, getIsStable, getName, hasCollapsed, isEndPoint, isIntergalactic, reduceIntegrity, setDiameter, setEndPointID1, setEndPointID2, setIntegrity, setIsStable |
Methods inherited from class org.gjt.universe.DBItem |
getLocation, getOwner |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private VectorSystemID alternateEndPointIDs
private int oscillationPeriod
private int oscillationCountdown
private int nextIndex
Constructor Detail |
public WormholeOscillating(SystemID ep1, VectorSystemID alt_eps, float d, boolean s, float i, int p)
ep1
- The ID of the star system at the fixed end point of the wormhole.alt_eps
- The list of IDs of the star systems that may be at the other end point of the wormhole.d
- The diameter of the wormhole (in meters)s
- True if the wormhole is currently stable, false otherwise.i
- The initial integrity value of the wormholep
- The period of oscillation (in game turns).public WormholeOscillating()
Method Detail |
private void prepareForOscillation()
public boolean isOscillating()
isOscillating
in class Wormhole
WormholeOscillating
public VectorSystemID alternateEndPointIDs()
public void setAlternateEndPointIDs(VectorSystemID newValue)
newValue
- A vector of 2 or more distinct system IDs.public boolean isAlternateEndPointID(SystemID anID)
anID
- The ID of the star system being tested.public int getOsciliationPeriod()
public void setOscillationPeriod(int newValue)
newValue
- The new value to be adopted.public void turnProcessed()
turnProcessed
in interface TurnProcessedListener
public VectorDisplayReturn specificDisplayDebug()
specificDisplayDebug
in class Wormhole
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |