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

Resources Class Reference

The Container for the three different Resources that ASC uses. More...

#include <typen.h>

List of all members.

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 ()

Static Public Member Functions

static const char * name (int r)

Public Attributes

int energy
int material
int fuel

Static Public Attributes

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


Detailed Description

The Container for the three different Resources that ASC uses.

Definition at line 83 of file typen.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
Energy 
Material 
Fuel 

Definition at line 116 of file typen.h.


Constructor & Destructor Documentation

Resources::Resources void   )  [inline]
 

Definition at line 107 of file typen.h.

Resources::Resources int  e,
int  m,
int  f
[inline]
 

Definition at line 108 of file typen.h.


Member Function Documentation

const char * Resources::name int  r  )  [static]
 

Definition at line 177 of file typen.cpp.

References resourceNames.

Referenced by ResourceTransferrable::getName(), CargoGuiFunctions::RecycleUnit::getName(), showCargoSummary(), and MatterAndMiningBaseWindow::update().

bool Resources::operator!= const Resources res  )  [inline]
 

Definition at line 114 of file typen.h.

References energy, fuel, and material.

Resources& Resources::operator+= const Resources res  )  [inline]
 

Definition at line 115 of file typen.h.

References energy, fuel, and material.

Resources& Resources::operator-= const Resources res  )  [inline]
 

Definition at line 109 of file typen.h.

References energy, fuel, and material.

bool Resources::operator< const Resources res  )  [inline]
 

Definition at line 111 of file typen.h.

bool Resources::operator== const Resources res  )  [inline]
 

Definition at line 113 of file typen.h.

References energy, fuel, and material.

bool Resources::operator>= const Resources res  )  [inline]
 

Definition at line 110 of file typen.h.

References energy, fuel, and material.

void Resources::read tnstream stream  ) 
 

Definition at line 182 of file typen.cpp.

References tnstream::readInt(), resource(), and resourceTypeNum.

Referenced by Vehicletype::read(), ObjectType::read(), GameMap::ResourceTribute::read(), GameMap::read(), AddResources::readData(), and ResourceTribute::readData().

const int& Resources::resource int  type  )  const [inline]
 

Definition at line 98 of file typen.h.

References energy, fuel, and material.

int& Resources::resource int  type  )  [inline]
 

Definition at line 89 of file typen.h.

References energy, fuel, and material.

Referenced by ContainerControls::ammoProducable(), ResourceWatch::avail(), BuildingTypeResourceWidget::BuildingTypeResourceWidget(), PutTribute::checkbuilding(), PutResource::checkbuilding(), GetResource::checkbuilding(), VehicleService::FieldSearch::checkBuilding2Vehicle(), GuiFunctions::ObjectBuildingGui::checkObject(), compareMapResources(), Building::convert(), Vehicle::endOwnTurn(), Building::execnetcontrol(), trunreplay::execnextreplaymove(), MiningStation::finished(), RegenerativePowerPlant::finished(), ResourceSink::finished(), Vehicle::getAvailableResource(), MiningGraph::getBarHeight(), ContainerBase::getMaxRepair(), CargoGuiFunctions::RecycleUnit::getName(), MiningWindow::getOutput(), getPlayerStrength(), SolarPowerplant::getPlus(), WindPowerplant::getPlus(), MatterConverter::getPlus(), Vehicle::getResource(), ResourceWatch::getResource(), ContainerBase::getResource(), ResourceWatch::getResources(), MiningStation::getUsage(), ResourceSink::getUsage(), MatterConverter::getUsage(), MiningStation::MiningStation(), ContainerBase::netResourcePlus(), Building::newFromStream(), operator *(), ResourceMatrix::operator *(), operator/(), Vehicle::putResource(), ResourceWatch::putResource(), ContainerBase::putResource(), Vehicletype::read(), read(), GameMap::ResourceTribute::read(), Building::read(), resourceAnalysis(), resourceComparison(), ResourceSink::ResourceSink(), ResourceWatch::ResourceWatch(), returnResourcenUseForResearch(), VehicleService::FieldSearch::run(), MiningStation::run(), RegenerativePowerPlant::run(), ResourceSink::run(), MatterConverter::run(), VehicleTypeSelectionItemFactory::spawnNextItem(), BuildingTypeSelectionItemFactory::spawnNextItem(), PutTribute::start(), PutResource::start(), GetResource::start(), MiningStation::testfield(), toString(), transfer_all_outstanding_tribute(), ContainerConstControls::unitProductionPrerequisites(), ResearchWindow::update(), VehicleTypeResourceWidget::VehicleTypeResourceWidget(), write(), and Building::write().

void Resources::runTextIO PropertyContainer pc,
const Resources defaultValue
 

Definition at line 242 of file typen.cpp.

References energy, fuel, and material.

void Resources::runTextIO PropertyContainer pc  ) 
 

Definition at line 235 of file typen.cpp.

References energy, fuel, and material.

Referenced by SingleWeapon::runTextIO(), Vehicletype::runTextIO(), ObjectType::runTextIO(), ContainerBaseType::runTextIO(), and BuildingType::runTextIO().

ASCString Resources::toString  ) 
 

Definition at line 249 of file typen.cpp.

References ASCString::format(), resource(), and resourceNames.

Referenced by GuiFunctions::RepairUnit::getName(), CargoGuiFunctions::RepairUnit::getName(), resourceAnalysis(), and transfer_all_outstanding_tribute().

void Resources::write tnstream stream  )  const
 

Definition at line 188 of file typen.cpp.

References resource(), resourceTypeNum, and tnstream::writeInt().

Referenced by Vehicletype::write(), Vehicle::write(), ObjectType::write(), GameMap::ResourceTribute::write(), GameMap::write(), AddResources::writeData(), and ResourceTribute::writeData().


Member Data Documentation

int Resources::energy
 

Definition at line 85 of file typen.h.

Referenced by Vehicletype::calcProductionsCost(), destructbuildinglevel2(), doresearch(), Vehicle::endRound(), trunreplay::execnextreplaymove(), ResourceTribute::getDetailledName(), GuiFunctions::VehicleBuildingGui::getName(), ResearchGraph::getPoint(), BuildingValues::init(), logtoreplayinfo(), operator!=(), operator+=(), operator-=(), operator==(), operator>=(), putbuilding2(), Vehicletype::read(), BuildingType::read(), resource(), resourceAnalysis(), Vehicletype::runTextIO(), runTextIO(), AddResources::setup(), ResourceTribute::setup(), GameMap::startGame(), Vehicle::transform(), UnitInfoDialog::UnitInfoDialog(), unitStrengthValue(), BuildingControlWindow::update(), WindPowerWindow::update(), SolarPowerWindow::update(), Vehicle::vehicleconstructable(), Vehicle::write(), and BuildingType::write().

const int Resources::energyColor = 0x3b2dd7 [static]
 

Definition at line 126 of file typen.h.

int Resources::fuel
 

Definition at line 87 of file typen.h.

Referenced by Vehicle::buildingconstructable(), Vehicletype::calcProductionsCost(), Vehicle::constructvehicle(), destructbuildinglevel2(), doresearch(), Vehicle::endRound(), trunreplay::execnextreplaymove(), GuiFunctions::BuildingConstruction::execute(), VehicleProduction_SelectionItemFactory::getCost(), getDestructionCost(), ResourceTribute::getDetailledName(), Vehicle::getMovement(), GuiFunctions::BuildingConstruction::getName(), GuiFunctions::ObjectBuildingGui::getName(), UnitPropertyEditor::init(), BuildingValues::init(), CargoItemFactory::itemSelected(), logtoreplayinfo(), operator!=(), operator+=(), operator-=(), operator==(), operator>=(), putbuilding2(), BuildingType::read(), resource(), resourceAnalysis(), resourceComparison(), Vehicletype::runTextIO(), runTextIO(), AddResources::setup(), ResourceTribute::setup(), GameMap::startGame(), GetMiningInfo::testfield(), UnitInfoDialog::UnitInfoDialog(), BuildingControlWindow::update(), Vehicle::vehicleconstructable(), Vehicle::write(), and BuildingType::write().

const int Resources::fuelColor = 0x00ff00 [static]
 

Definition at line 125 of file typen.h.

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

int Resources::material
 

Definition at line 86 of file typen.h.

Referenced by Vehicle::buildingconstructable(), ContainerControls::calcDestructionOutput(), Vehicletype::calcProductionsCost(), Vehicle::constructvehicle(), destructbuildinglevel2(), ContainerControls::destructUnit(), doresearch(), trunreplay::execnextreplaymove(), GuiFunctions::BuildingConstruction::execute(), VehicleProduction_SelectionItemFactory::getCost(), getDestructionCost(), ResourceTribute::getDetailledName(), GuiFunctions::BuildingConstruction::getName(), GuiFunctions::VehicleBuildingGui::getName(), GuiFunctions::ObjectBuildingGui::getName(), getPlayerStrength(), UnitPropertyEditor::init(), BuildingValues::init(), CargoItemFactory::itemSelected(), logtoreplayinfo(), operator!=(), operator+=(), operator-=(), operator==(), operator>=(), putbuilding2(), Vehicletype::read(), BuildingType::read(), resource(), resourceAnalysis(), resourceComparison(), Vehicletype::runTextIO(), runTextIO(), AddResources::setup(), ResourceTribute::setup(), GameMap::startGame(), GetMiningInfo::testfield(), UnitInfoDialog::UnitInfoDialog(), unitStrengthValue(), BuildingControlWindow::update(), Vehicle::vehicleconstructable(), Vehicle::write(), and BuildingType::write().

const int Resources::materialColor = 0xff0000 [static]
 

Definition at line 124 of file typen.h.

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


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