Advanced Strategic Command
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Resources Class Reference

Resources are basically the currency of ASC. More...

#include <typen.h>

Public Types

enum  { Energy, Material, Fuel }
 

Public Member Functions

int & resource (int type)
 
const int & resource (int type) const
 
 Resources (void)
 
 Resources (int e, int m, int f)
 
Resourcesoperator-= (const Resources &res)
 
bool operator>= (const Resources &res)
 
bool operator< (const Resources &res)
 
bool operator== (const Resources &res)
 
bool operator!= (const Resources &res)
 
Resourcesoperator+= (const Resources &res)
 
void read (tnstream &stream)
 
void write (tnstream &stream) const
 
void runTextIO (PropertyContainer &pc)
 
void runTextIO (PropertyContainer &pc, const Resources &defaultValue)
 
ASCString toString () const
 

Static Public Member Functions

static const char * name (int r)
 

Public Attributes

int energy
 
int material
 
int fuel
 

Static Public Attributes

static const int count = 3
 
static const int materialColor = 0xff0000
 
static const int fuelColor = 0x00ff00
 
static const int energyColor = 0x3b2dd7
 

Detailed Description

Resources are basically the currency of ASC.

You use resources to buy units, to do research, to propulse your units and lots of other things.

ASC has 3 different kinds of Resources:

Definition at line 97 of file typen.h.

Member Enumeration Documentation

anonymous enum
Enumerator
Energy 
Material 
Fuel 

Definition at line 132 of file typen.h.

Constructor & Destructor Documentation

Resources::Resources ( void  )
inline

Definition at line 123 of file typen.h.

Resources::Resources ( int  e,
int  m,
int  f 
)
inline

Definition at line 124 of file typen.h.

Member Function Documentation

const char * Resources::name ( int  r)
static
bool Resources::operator!= ( const Resources res)
inline

Definition at line 130 of file typen.h.

References energy, fuel, and material.

Resources& Resources::operator+= ( const Resources res)
inline

Definition at line 131 of file typen.h.

References energy, fuel, and material.

Resources& Resources::operator-= ( const Resources res)
inline

Definition at line 125 of file typen.h.

References energy, fuel, and material.

bool Resources::operator< ( const Resources res)
inline

Definition at line 127 of file typen.h.

bool Resources::operator== ( const Resources res)
inline

Definition at line 129 of file typen.h.

References energy, fuel, and material.

bool Resources::operator>= ( const Resources res)
inline

Definition at line 126 of file typen.h.

References energy, fuel, and material.

void Resources::read ( tnstream stream)
int& Resources::resource ( int  type)
inline

Definition at line 105 of file typen.h.

References energy, fuel, and material.

Referenced by ResourceWatch::avail(), ConstructBuildingCommand::buildingProductionPrerequisites(), BuildingTypeResourceWidget::BuildingTypeResourceWidget(), ServiceChecker::check(), GetResource::checkbuilding(), PutResource::checkbuilding(), PutTribute::checkbuilding(), GetResourceCapacity::checkbuilding(), GetResourcePlus::checkbuilding(), GetResourceUsage::checkbuilding(), compareMapResources(), Building::convert(), Vehicle::endOwnTurn(), Building::execnetcontrol(), trunreplay::execnextreplaymove(), ResourceSink::finished(), RegenerativePowerPlant::finished(), MiningStation::finished(), ResourceTransferrable::getAmount(), ResourceTransferrable::getAvail(), Vehicle::getAvailableResource(), MiningGraph::getBarHeight(), ResourceTransferrable::getMax(), ContainerBase::getMaxRepair(), ResourceTransferrable::getMin(), SetResourceProcessingRateCommand::getNewPlus(), MatterConversionWindow::getOutput(), MiningWindow::getOutput(), getPlayerStrength(), MatterConverter::getPlus(), WindPowerplant::getPlus(), SolarPowerplant::getPlus(), ResourceWatch::getResource(), Vehicle::getResource(), ContainerBase::getResource(), ResourceWatch::getResources(), MatterConverter::getUsage(), ResourceSink::getUsage(), MiningStation::getUsage(), BuildingValues::init(), MiningStation::MiningStation(), ContainerBase::netResourcePlus(), Building::newFromStream(), operator*(), ResourceMatrix::operator*(), operator/(), ResourceWatch::putResource(), Vehicle::putResource(), ContainerBase::putResource(), Building::read(), read(), VehicleType::read(), StatisticsCalculator::resource(), resourceAnalysis(), resourceComparison(), ResourceSink::ResourceSink(), ResourceWatch::ResourceWatch(), returnResourcenUseForResearch(), MatterConverter::run(), ResourceSink::run(), RegenerativePowerPlant::run(), MiningStation::run(), DataTab::setData(), ContainerBase::setInternalResourceMaxPlus(), ContainerBase::setInternalResourcePlus(), BuildingTypeSelectionItemFactory::spawnNextItem(), VehicleTypeSelectionItemFactory::spawnNextItem(), GetResource::start(), PutResource::start(), PutTribute::start(), MiningStation::testfield(), toString(), transfer_all_outstanding_tribute(), ContainerConstControls::unitProductionPrerequisites(), ConstructUnitCommand::unitProductionPrerequisites(), ResearchWindow::update(), MatterAndMiningBaseWindow::update(), VehicleTypeResourceWidget::VehicleTypeResourceWidget(), viewMiningPower(), Building::write(), and write().

const int& Resources::resource ( int  type) const
inline

Definition at line 114 of file typen.h.

References energy, fuel, and material.

void Resources::runTextIO ( PropertyContainer pc)
void Resources::runTextIO ( PropertyContainer pc,
const Resources defaultValue 
)

Definition at line 261 of file typen.cpp.

References PropertyContainer::addInteger(), energy, fuel, and material.

ASCString Resources::toString ( ) const
void Resources::write ( tnstream stream) const

Member Data Documentation

const int Resources::count = 3
static
int Resources::energy
const int Resources::energyColor = 0x3b2dd7
static

Definition at line 142 of file typen.h.

int Resources::fuel
const int Resources::fuelColor = 0x00ff00
static

Definition at line 141 of file typen.h.

Referenced by MiningGraph::MiningGraph(), and ResourceGraphLayer::paintSingleField().

int Resources::material
const int Resources::materialColor = 0xff0000
static

Definition at line 140 of file typen.h.

Referenced by MiningGraph::MiningGraph(), and ResourceGraphLayer::paintSingleField().


The documentation for this class was generated from the following files: