Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

TechDependency Class Reference

#include <research.h>

Inheritance diagram for TechDependency:

Inheritance graph
[legend]
List of all members.

Public Types

typedef Loki::Functor< bool,
TYPELIST_1(int) 
CheckTechAvailabilityFunctor )

Public Member Functions

 TechDependency ()
bool available (const Research &research) const
ResearchAvailabilityStatus available (CheckTechAvailabilityFunctor checkTechAvailability) const
bool eventually_available (const Research &res, list< const Technology * > *dependencies) const
 this will recursively scan through the tech tree to check if this item will be available sometime.
bool eventually_available (const Research &res, list< const Technology * > *dependencies, list< int > &stack) const
ASCString showDebug (const Research &research) const
void read (tnstream &stream)
void write (tnstream &stream) const
void runTextIO (PropertyContainer &pc)
bool empty () const
void writeTreeOutput (const ASCString &sourceTechName, tnstream &stream, bool reduce) const
 outputs the dependencies in text format for processing by GraphViz
void writeInvertTreeOutput (const Technology *tech, tnstream &stream, vector< int > &history, vector< pair< int, int > > &blockedPrintList, const vector< IntRange > *onlyWithBaseTechs=NULL) const
void writeInvertTreeOutput (const ASCString techName, tnstream &stream, vector< int > &history, vector< pair< int, int > > &blockedPrintList, const vector< IntRange > *onlyWithBaseTechs=NULL) const
int findInheritanceLevel (int id, vector< int > &stack, const ASCString &sourceTechName) const

Member Typedef Documentation

typedef Loki::Functor<bool, TYPELIST_1(int) TechDependency::CheckTechAvailabilityFunctor)
 

Definition at line 60 of file research.h.


Constructor & Destructor Documentation

TechDependency::TechDependency  )  [inline]
 

Definition at line 57 of file research.h.


Member Function Documentation

ResearchAvailabilityStatus TechDependency::available CheckTechAvailabilityFunctor  checkTechAvailability  )  const
 

Definition at line 66 of file research.cpp.

References Available, NeverAvailable, and UnavailableNow.

bool TechDependency::available const Research research  )  const
 

Definition at line 61 of file research.cpp.

References Available, and Research::techResearched().

Referenced by TechAdapter::available(), Research::isBlocked(), and Research::techAvailable().

bool TechDependency::empty  )  const [inline]
 

Definition at line 75 of file research.h.

bool TechDependency::eventually_available const Research res,
list< const Technology * > *  dependencies,
list< int > &  stack
const
 

Definition at line 104 of file research.cpp.

bool TechDependency::eventually_available const Research res,
list< const Technology * > *  dependencies
const
 

this will recursively scan through the tech tree to check if this item will be available sometime.

Parameters:
dependencies if not NULL, the technologies which have to be developed prior to this one will be added here

Definition at line 124 of file research.cpp.

Referenced by Technology::eventually_available().

int TechDependency::findInheritanceLevel int  id,
vector< int > &  stack,
const ASCString sourceTechName
const
 

Definition at line 132 of file research.cpp.

References technologyRepository, and warning().

Referenced by generateTechTree(), writeInvertTreeOutput(), and writeTreeOutput().

void TechDependency::read tnstream stream  )  [virtual]
 

Implements LoadableItemType.

Definition at line 33 of file research.cpp.

References tnstream::getDeviceName(), readClassContainer(), tnstream::readInt(), and techDependencyVersion.

Referenced by Technology::read(), and TechAdapter::read().

void TechDependency::runTextIO PropertyContainer pc  )  [virtual]
 

Implements LoadableItemType.

Definition at line 53 of file research.cpp.

References PropertyContainer::addBool(), PropertyContainer::addIntRangeArray(), PropertyContainer::find(), and PropertyContainer::isReading().

Referenced by Technology::runTextIO(), and TechAdapter::runTextIO().

ASCString TechDependency::showDebug const Research research  )  const
 

Definition at line 333 of file research.cpp.

References technologyRepository.

Referenced by ChooseTech::showPrerequisites().

void TechDependency::write tnstream stream  )  const [virtual]
 

Implements LoadableItemType.

Definition at line 45 of file research.cpp.

References techDependencyVersion, writeClassContainer(), and tnstream::writeInt().

Referenced by Technology::write(), and TechAdapter::write().

void TechDependency::writeInvertTreeOutput const ASCString  techName,
tnstream stream,
vector< int > &  history,
vector< pair< int, int > > &  blockedPrintList,
const vector< IntRange > *  onlyWithBaseTechs = NULL
const
 

Definition at line 289 of file research.cpp.

References findInheritanceLevel(), generateTechName(), technologyRepository, and tnstream::writeString().

void TechDependency::writeInvertTreeOutput const Technology tech,
tnstream stream,
vector< int > &  history,
vector< pair< int, int > > &  blockedPrintList,
const vector< IntRange > *  onlyWithBaseTechs = NULL
const
 

Definition at line 239 of file research.cpp.

References findInheritanceLevel(), generateTechLabel(), generateTechName(), Technology::id, technologyRepository, and tnstream::writeString().

void TechDependency::writeTreeOutput const ASCString sourceTechName,
tnstream stream,
bool  reduce
const
 

outputs the dependencies in text format for processing by GraphViz

Definition at line 175 of file research.cpp.

References findInheritanceLevel(), Technology::name, technologyRepository, and tnstream::writeString().

Referenced by generateTechTree().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:21:22 2008 for Advanced Strategic Command by  doxygen 1.4.2