|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.universe.ProtoObject
ProtoObject.java
Created: Wed Jun 14 09:29:45 2000
ProtoObject is the base class from which ProtoTech, ProtoModule,
and ProtoShip are derived. A ProtoObject is created by a OrderTransfer
when OrderTransfer.submit() is
called. The ProtoObject represents the item under
construction/research. It knows how many production points are needed
for it to be complete, what turn it is, how many points were
transferred to it this turn, and how many more points it needs. It
also knows how to create the actual object when it is complete.
It also contains methods to get the completion percentage and time remaining.
Field Summary | |
(package private) int |
currentTurn
Keeps track of the current turn. |
(package private) float |
productionThisTurn
Keeps track of the amount of production added to the ProtoObject this turn. |
(package private) float |
totalProduction
Keeps track of the total production added to the ProtoObject. |
(package private) float |
totalProductionNeeded
The amount of production needed to build this object. |
Constructor Summary | |
ProtoObject()
|
Method Summary | |
void |
addProduction(float newProduction,
int turn)
Adds production to the ProtoObject. |
(package private) abstract void |
buildObject()
Object type specific method to build the actual object. |
int |
getEstimatedTimeOfCompletion()
Estimated time until this object is complete. |
(package private) abstract Index |
getKey()
|
float |
getPercentageCompletion()
Gets the completion percentage. |
float |
getProductionNeeded()
|
(package private) static ProtoObject |
newProtoObject(StationID BID,
ModuleDesignID EID)
|
(package private) static ProtoObject |
newProtoObject(StationID BID,
ShipDesignID DID)
|
(package private) static ProtoObject |
newProtoObject(StationID BID,
TechID TID)
|
(package private) abstract boolean |
prereqs()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
int currentTurn
float productionThisTurn
float totalProduction
float totalProductionNeeded
Constructor Detail |
public ProtoObject()
Method Detail |
static ProtoObject newProtoObject(StationID BID, ShipDesignID DID)
static ProtoObject newProtoObject(StationID BID, ModuleDesignID EID)
static ProtoObject newProtoObject(StationID BID, TechID TID)
public float getProductionNeeded()
public void addProduction(float newProduction, int turn)
newProduction
- Amount of production to add.turn
- The current turn.public int getEstimatedTimeOfCompletion()
public float getPercentageCompletion()
abstract void buildObject()
abstract boolean prereqs()
abstract Index getKey()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |