org.gjt.universe
Class KnowledgeBase

java.lang.Object
  |
  +--org.gjt.universe.DBItem
        |
        +--org.gjt.universe.KnowledgeBase
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
KnowledgeAlien, KnowledgeFleet, KnowledgeModuleDesign, KnowledgePlanet, KnowledgeShip, KnowledgeShipDesign, KnowledgeStation, KnowledgeSystem, KnowledgeTech, KnowledgeUndefined

public abstract class KnowledgeBase
extends DBItem

This is the base class for all Knowledge objects. Knowledge objects are used to implement the "fog of war".

See Also:
Serialized Form

Field Summary
private  int age
           
private static KnowledgeID currentID
           
private  KnowledgeID ID
           
private  CivID owner
           
 
Constructor Summary
protected KnowledgeBase()
          Constructor for an Knowledge object that requires an ID.
protected KnowledgeBase(boolean dummy)
          Constructor for an undefined Knowledge object.
protected KnowledgeBase(CivID AID)
           
 
Method Summary
(package private) abstract  void createSubKnowledge()
          This method is called when a new knowledge is created.
(package private)  int getAge()
          Returns the "age" (turn number) of this knowledge.
 KnowledgeID getID()
          Returns the ID of this knowledge.
 Index getIndex()
          Returns the ID of this knowledge.
 java.lang.String getName()
           
 CivID getOwner()
          Returns the owner of this Knowledge.
(package private)  void setOwner(CivID AID)
          Sets the owner of this knowledge.
(package private)  void updateAge()
          Updates the age of this knowledge to the current turn.
 
Methods inherited from class org.gjt.universe.DBItem
getLocation, specificDisplayDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentID

private static KnowledgeID currentID

ID

private KnowledgeID ID

owner

private CivID owner

age

private int age
Constructor Detail

KnowledgeBase

protected KnowledgeBase(boolean dummy)
Constructor for an undefined Knowledge object.


KnowledgeBase

protected KnowledgeBase()
Constructor for an Knowledge object that requires an ID.


KnowledgeBase

protected KnowledgeBase(CivID AID)
Method Detail

getID

public KnowledgeID getID()
Returns the ID of this knowledge.


getIndex

public Index getIndex()
Returns the ID of this knowledge.

Specified by:
getIndex in class DBItem

getName

public java.lang.String getName()
Specified by:
getName in class DBItem

setOwner

void setOwner(CivID AID)
Sets the owner of this knowledge.


getOwner

public CivID getOwner()
Returns the owner of this Knowledge.

Overrides:
getOwner in class DBItem

getAge

int getAge()
Returns the "age" (turn number) of this knowledge.


updateAge

void updateAge()
Updates the age of this knowledge to the current turn.


createSubKnowledge

abstract void createSubKnowledge()
This method is called when a new knowledge is created. Any related "sub"-knowledge objects will be created by this method. For example, if a Tech is discovered, then some other ModuleDesigns will be discovered by this method.



Copyright © 2001 Universe Dev Team All Rights Reserved.