Advanced Strategic Command
Public Types | Public Member Functions | List of all members
TechDependency Class Reference

#include <research.h>

Inheritance diagram for TechDependency:
Inheritance graph
[legend]

Public Types

typedef Loki::Functor< bool,
LOKI_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. More...
 
bool eventually_available (const Research &res, list< const Technology * > *dependencies, list< int > &stack) const
 
ASCString showDebug (const Research &research) const
 
void read (tnstream &stream)
 read the binary representation of this item from the given stream More...
 
void write (tnstream &stream) const
 write the binary representation of this item to the given stream More...
 
void runTextIO (PropertyContainer &pc)
 registers the properties of this item for loading/writing into asctxt files More...
 
bool empty () const
 
void writeTreeOutput (const ASCString &sourceTechName, tnstream &stream, bool reduce) const
 outputs the dependencies in text format for processing by GraphViz More...
 
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
 
- Public Member Functions inherited from LoadableItemType
virtual ~LoadableItemType ()
 

Additional Inherited Members

- Public Attributes inherited from LoadableItemType
ASCString filename
 The name of the file from which the item was loaded. More...
 
ASCString location
 The filename and location on disk (including containerfiles) of the object. More...
 
ASCString archive
 

Detailed Description

Definition at line 48 of file research.h.

Member Typedef Documentation

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

Definition at line 61 of file research.h.

Constructor & Destructor Documentation

TechDependency::TechDependency ( )
inline

Definition at line 58 of file research.h.

Member Function Documentation

bool TechDependency::available ( const Research research) const
ResearchAvailabilityStatus TechDependency::available ( CheckTechAvailabilityFunctor  checkTechAvailability) const

Definition at line 66 of file research.cpp.

References Available, NeverAvailable, and UnavailableNow.

bool TechDependency::empty ( ) const
inline

Definition at line 76 of file research.h.

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
dependenciesif not NULL, the technologies which have to be developed prior to this one will be added here

Definition at line 122 of file research.cpp.

Referenced by Technology::eventually_available().

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

Definition at line 102 of file research.cpp.

int TechDependency::findInheritanceLevel ( int  id,
vector< int > &  stack,
const ASCString sourceTechName 
) const
void TechDependency::read ( tnstream stream)
virtual

read the binary representation of this item from the given stream

Implements LoadableItemType.

Definition at line 33 of file research.cpp.

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

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

void TechDependency::runTextIO ( PropertyContainer pc)
virtual

registers the properties of this item for loading/writing into asctxt files

Implements LoadableItemType.

Definition at line 53 of file research.cpp.

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

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

ASCString TechDependency::showDebug ( const Research research) const
void TechDependency::write ( tnstream stream) const
virtual

write the binary representation of this item to the given stream

Implements LoadableItemType.

Definition at line 45 of file research.cpp.

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

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

void TechDependency::writeInvertTreeOutput ( const Technology tech,
tnstream stream,
vector< int > &  history,
vector< pair< int, int > > &  blockedPrintList,
const vector< IntRange > *  onlyWithBaseTechs = NULL 
) const
void TechDependency::writeInvertTreeOutput ( const ASCString  techName,
tnstream stream,
vector< int > &  history,
vector< pair< int, int > > &  blockedPrintList,
const vector< IntRange > *  onlyWithBaseTechs = NULL 
) const
void TechDependency::writeTreeOutput ( const ASCString sourceTechName,
tnstream stream,
bool  reduce 
) const

outputs the dependencies in text format for processing by GraphViz

Definition at line 173 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: