Advanced Strategic Command
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ContainerBaseType Class Referenceabstract

#include <containerbasetype.h>

Inheritance diagram for ContainerBaseType:
Inheritance graph
[legend]

Classes

class  TransportationIO
 

Public Types

enum  ContainerFunctions {
  TrainingCenter, InternalVehicleProduction, AmmoProduction, InternalUnitRepair,
  RecycleUnits, Research, Sonar, SatelliteView,
  MineView, WindPowerPlant, SolarPowerPlant, MatterConverter,
  MiningStation, ProduceNonLeavableUnits, ResourceSink, ExternalEnergyTransfer,
  ExternalMaterialTransfer, ExternalFuelTransfer, ExternalAmmoTransfer, ExternalRepair,
  NoObjectChaining, SelfDestructOnConquer, Paratrooper, PlaceMines,
  CruiserLanding, ConquerBuildings, MoveAfterAttack, ExternalVehicleProduction,
  ConstructBuildings, IceBreaker, NoInairRefuelling, MakesTracks,
  DetectsMineralResources, NoReactionfire, AutoRepair, KamikazeOnly,
  ImmuneToMines, JamsOnlyOwnField, MoveWithReactionFire, OnlyMoveToAndFromTransports,
  AutoHarvestObjects, NoProductionCustomization, ManualSelfDestruct, NoMineRemoval,
  NoImageRotation
}
 
typedef vector< TransportationIOEntranceSystems
 

Public Member Functions

 ContainerBaseType ()
 
bool hasFunction (ContainerFunctions function) const
 
bool hasAnyFunction (std::bitset< 64 > functions) const
 
ASCString getName () const
 
int getID () const
 
int getHeight () const
 
virtual ~ContainerBaseType ()
 
void runTextIO (PropertyContainer &pc)
 registers the properties of this item for loading/writing into asctxt files More...
 
bool vehicleFit (const VehicleType *type) const
 can units of the given type be moved into this buildtype? This is a prerequisite - but not the only requirement - for a real unit to move into a real building More...
 
int vehicleUnloadable (const VehicleType *vehicleType, int carrierHeight) const
 checks the unloading of a unit type More...
 
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...
 
virtual int getMoveMalusType () const =0
 
Resources getStorageCapacity (int mode) const
 returns the Storage capacity of the unit More...
 
- Public Member Functions inherited from MapItemType
virtual ~MapItemType ()
 
- Public Member Functions inherited from LoadableItemType
virtual ~LoadableItemType ()
 
- Public Member Functions inherited from MemorySizeQueryInterface
virtual int getMemoryFootprint () const =0
 
virtual ~MemorySizeQueryInterface ()
 

Static Public Member Functions

static const char * getFunctionName (ContainerFunctions function)
 

Public Attributes

int id
 
vector< int > secondaryIDs
 when loading a file and these IDs are encountered, this object will be used. More...
 
ASCString name
 a short name, for example B-52 More...
 
ASCString description
 short description of the units role, for example "strategic bomber" More...
 
ASCString infotext
 an extensive information about the unit/building which may be several paragraphs long More...
 
int jamming
 the radar jamming power More...
 
int view
 the visibility range More...
 
int height
 the levels of height which this unit can enter More...
 
Resources productionCost
 
int maxLoadableUnits
 the maximum number of units that can be loaded More...
 
int maxLoadableUnitSize
 the maximum size of a unit that may enter the building More...
 
int maxLoadableWeight
 the maximum total weight of all loaded units More...
 
int vehicleCategoriesStorable
 bitmapped: vehicle categories that can be stored the container More...
 
int vehicleCategoriesProduceable
 bitmapped: vehicle categories that can be produced in the container More...
 
vector< IntRangevehiclesInternallyProduceable
 the default production capabilities of this container. More...
 
EntranceSystems entranceSystems
 
TechAdapterDependency techDependency
 
ASCString infoImageFilename
 the filename of an image that is shown in info dialogs More...
 
ASCString infoImageSmallFilename
 
int efficiencyfuel
 currently only used by mining stations: the efficiency of the resource extraction from the ground. Base is 1024 More...
 
int efficiencymaterial
 currently only used by mining stations: the efficiency of the resource extraction from the ground. Base is 1024 More...
 
int maxresearchpoints
 the maximum number of research points a research center may produce More...
 
int defaultMaxResearchpoints
 when a building of this type is placed on a map, its maxResearch property will be set to this value More...
 
int nominalresearchpoints
 the number of reseach points for which the plus settings apllies More...
 
int minFieldRepairDamage
 if the unit is repaired in the field (that is, not inside a transport or building), it can only be repaired up to this level 0 would result in a complete repair being possible, 20 that it can only be restored to 20% damage (80% health). More...
 
Resources maxplus
 
Resources defaultProduction
 if a new building is constructed, this will be the resource production of the building More...
 
ResourceMatrix productionEfficiency
 
struct {
   int   range
 
   int   maxFieldsPerTurn
 
   vector< IntRange >   objectsHarvestable
 the ids of objects this unit can construct More...
 
   vector< IntRange >   objectGroupsHarvestable
 the group-ids of objects this unit can construct More...
 
autoHarvest
 
- 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
 

Static Public Attributes

static const int functionNum = 45
 

Protected Member Functions

void setFunction (ContainerFunctions function)
 

Protected Attributes

std::bitset< 64 > features
 
Resources asc_mode_tank
 
Resources bi_mode_tank
 

Detailed Description

Definition at line 27 of file containerbasetype.h.

Member Typedef Documentation

Definition at line 177 of file containerbasetype.h.

Member Enumeration Documentation

Enumerator
TrainingCenter 
InternalVehicleProduction 
AmmoProduction 
InternalUnitRepair 
RecycleUnits 
Research 
Sonar 
SatelliteView 
MineView 
WindPowerPlant 
SolarPowerPlant 
MatterConverter 
MiningStation 
ProduceNonLeavableUnits 
ResourceSink 
ExternalEnergyTransfer 
ExternalMaterialTransfer 
ExternalFuelTransfer 
ExternalAmmoTransfer 
ExternalRepair 
NoObjectChaining 
SelfDestructOnConquer 
Paratrooper 
PlaceMines 
CruiserLanding 
ConquerBuildings 
MoveAfterAttack 
ExternalVehicleProduction 
ConstructBuildings 
IceBreaker 
NoInairRefuelling 
MakesTracks 
DetectsMineralResources 
NoReactionfire 
AutoRepair 
KamikazeOnly 
ImmuneToMines 
JamsOnlyOwnField 
MoveWithReactionFire 
OnlyMoveToAndFromTransports 
AutoHarvestObjects 
NoProductionCustomization 
ManualSelfDestruct 
NoMineRemoval 
NoImageRotation 

Definition at line 33 of file containerbasetype.h.

Constructor & Destructor Documentation

ContainerBaseType::ContainerBaseType ( )
virtual ContainerBaseType::~ContainerBaseType ( )
inlinevirtual

Definition at line 120 of file containerbasetype.h.

Member Function Documentation

const char * ContainerBaseType::getFunctionName ( ContainerFunctions  function)
static

Definition at line 115 of file containerbasetype.cpp.

References ccontainerfunctions, and functionNum.

Referenced by UnitInfoDialog::UnitInfoDialog().

int ContainerBaseType::getHeight ( ) const
inline

Definition at line 117 of file containerbasetype.h.

int ContainerBaseType::getID ( ) const
inlinevirtual

Implements MapItemType.

Definition at line 103 of file containerbasetype.h.

Referenced by DataTab::setData().

virtual int ContainerBaseType::getMoveMalusType ( ) const
pure virtual

Implemented in VehicleType, and BuildingType.

ASCString ContainerBaseType::getName ( ) const
inlinevirtual
Resources ContainerBaseType::getStorageCapacity ( int  mode) const

returns the Storage capacity of the unit

Parameters
mode0 = ASC Resource mode ; 1 = BI Resource mode

Definition at line 422 of file containerbasetype.cpp.

References asc_mode_tank, and bi_mode_tank.

Referenced by VehicleProduction_SelectionItemFactory::getCost(), UnitHooveringLogic::getEndurance(), ContainerBase::getStorageCapacity(), PBPUnitCostCalculator::productionCost(), DataTab::setData(), and UnitInfoDialog::UnitInfoDialog().

bool ContainerBaseType::hasAnyFunction ( std::bitset< 64 >  functions) const
bool ContainerBaseType::hasFunction ( ContainerFunctions  function) const

Definition at line 95 of file containerbasetype.cpp.

References features.

Referenced by ResearchGraph::addSecondaryLab(), TransferHandler::ammoProductionPossible(), Mine::attacksunit(), RemoveProductionLineCommand::avail(), PowerGenerationSwitchCommand::avail(), PutMineCommand::avail(), ReactionFireSwitchCommand::avail(), ConstructBuildingCommand::avail(), SetResourceProcessingRateCommand::avail(), TrainUnitCommand::avail(), BuildProductionLineCommand::avail(), DestructUnitCommand::avail(), DestructBuildingCommand::avail(), JumpDriveCommand::available(), ContextMenu::ContainerProduction::available(), SolarPowerWindow::available(), WindPowerWindow::available(), ResearchWindow::available(), RepairUnitCommand::availExternally(), RepairUnitCommand::availInternally(), calculateobject(), Building::canRepair(), Vehicle::canRepair(), SearchReconquerBuilding::canUnitCapture(), ServiceChecker::check(), Building::convert(), doresearch(), Vehicle::endRound(), evaluateProduction(), ServiceTargetSearcher::externallyAvailable(), AStar3D::findPath(), VehicleProduction_SelectionItemFactory::getAmmoFilling(), RecycleUnitCommand::getOutput(), ContainerBase::getProduction(), ContainerBase::getResourceUsage(), ReactionFireSwitchCommand::go(), MatterConversionWindow::hasFunction(), MiningWindow::hasFunction(), tcomputevehicleview::init(), tcomputebuildingview::init(), BuildingValues::init(), ConstructUnitCommand::internalConstructionAvail(), Vehicle::paint(), Vehicle::postAttack(), StandardUnitCostCalculator::productionCost(), PBPUnitCostCalculator::productionCost(), BuildProductionLineCommand::productionLinesBuyable(), PutMineCommand::PutMineCommand(), VehicleType::read(), returnResourcenUseForResearch(), ConvertContainer::runAction(), MoveUnit::runAction(), VehicleType::runTextIO(), Vehicle::setGeneratorStatus(), tunitattacksunit::setup(), tunitattacksbuilding::setup(), tunitattacksobject::setup(), DashboardPanel::showUnitData(), UnitInfoDialog::UnitInfoDialog(), ContainerConstControls::unitProductionAvailable(), ContainerConstControls::unitProductionPrerequisites(), ConstructUnitCommand::unitProductionPrerequisites(), ContainerBase::vehicleLoadable(), VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow(), and WeaponInfoPanel::WeaponInfoPanel().

void ContainerBaseType::read ( tnstream stream)
virtual
void ContainerBaseType::runTextIO ( PropertyContainer pc)
virtual
void ContainerBaseType::setFunction ( ContainerFunctions  function)
protected

Definition at line 107 of file containerbasetype.cpp.

References features.

Referenced by VehicleType::read(), and VehicleType::runTextIO().

bool ContainerBaseType::vehicleFit ( const VehicleType type) const
int ContainerBaseType::vehicleUnloadable ( const VehicleType vehicleType,
int  carrierHeight 
) const

checks the unloading of a unit type

Parameters
vehicleTypethe vehicletype for which the unloading is checked
carrierHeightassume the carrier was on this height (numerical: 0 - 7).
Returns
the levels of height on which this unit can be unloaded; or 0 if no unloading is possible

Definition at line 270 of file containerbasetype.cpp.

References entranceSystems, getheightdelta(), hasAnyFunction(), height, VehicleType::movemalustyp, ContainerBaseType::TransportationIO::Out, and vehicleFit().

Referenced by evaluateProduction(), and ContainerBase::vehicleUnloadable().

void ContainerBaseType::write ( tnstream stream) const
virtual

Member Data Documentation

Resources ContainerBaseType::asc_mode_tank
protected
struct { ... } ContainerBaseType::autoHarvest
Resources ContainerBaseType::bi_mode_tank
protected
int ContainerBaseType::defaultMaxResearchpoints

when a building of this type is placed on a map, its maxResearch property will be set to this value

Definition at line 214 of file containerbasetype.h.

Referenced by ContainerBase::ContainerBase(), ContainerBaseType(), BuildingType::read(), VehicleType::read(), runTextIO(), BuildingType::write(), and VehicleType::write().

Resources ContainerBaseType::defaultProduction

if a new building is constructed, this will be the resource production of the building

Definition at line 226 of file containerbasetype.h.

Referenced by ContainerBase::ContainerBase(), BuildingType::read(), VehicleType::read(), SpawnBuilding::runAction(), runTextIO(), BuildingType::write(), and VehicleType::write().

ASCString ContainerBaseType::description
int ContainerBaseType::efficiencyfuel

currently only used by mining stations: the efficiency of the resource extraction from the ground. Base is 1024

Definition at line 205 of file containerbasetype.h.

Referenced by ContainerBaseType(), BuildingValues::init(), BuildingType::read(), VehicleType::read(), runTextIO(), BuildingType::write(), and VehicleType::write().

int ContainerBaseType::efficiencymaterial

currently only used by mining stations: the efficiency of the resource extraction from the ground. Base is 1024

Definition at line 208 of file containerbasetype.h.

Referenced by ContainerBaseType(), BuildingValues::init(), BuildingType::read(), VehicleType::read(), runTextIO(), BuildingType::write(), and VehicleType::write().

EntranceSystems ContainerBaseType::entranceSystems
std::bitset<64> ContainerBaseType::features
protected
const int ContainerBaseType::functionNum = 45
static
int ContainerBaseType::height
int ContainerBaseType::id
ASCString ContainerBaseType::infoImageFilename

the filename of an image that is shown in info dialogs

Definition at line 183 of file containerbasetype.h.

Referenced by CargoDialog::CargoDialog(), read(), runTextIO(), UnitInfoDialog::UnitInfoDialog(), and write().

ASCString ContainerBaseType::infoImageSmallFilename
ASCString ContainerBaseType::infotext

an extensive information about the unit/building which may be several paragraphs long

Definition at line 103 of file containerbasetype.h.

Referenced by BuildingType::read(), VehicleType::read(), runTextIO(), UnitInfoDialog::UnitInfoDialog(), BuildingType::write(), and VehicleType::write().

int ContainerBaseType::jamming
int ContainerBaseType::maxFieldsPerTurn

Definition at line 245 of file containerbasetype.h.

int ContainerBaseType::maxLoadableUnits
int ContainerBaseType::maxLoadableUnitSize

the maximum size of a unit that may enter the building

Definition at line 126 of file containerbasetype.h.

Referenced by ContainerBaseType(), read(), runTextIO(), UnitInfoDialog::UnitInfoDialog(), CargoDialog::updateVariables(), vehicleFit(), and write().

int ContainerBaseType::maxLoadableWeight
Resources ContainerBaseType::maxplus
int ContainerBaseType::maxresearchpoints

the maximum number of research points a research center may produce

Definition at line 211 of file containerbasetype.h.

Referenced by ContainerBaseType(), BuildingValues::init(), BuildingType::read(), VehicleType::read(), runTextIO(), BuildingType::write(), and VehicleType::write().

int ContainerBaseType::minFieldRepairDamage

if the unit is repaired in the field (that is, not inside a transport or building), it can only be repaired up to this level 0 would result in a complete repair being possible, 20 that it can only be restored to 20% damage (80% health).

Definition at line 221 of file containerbasetype.h.

Referenced by ContainerBaseType(), Vehicle::endOwnTurn(), ContainerBase::getMaxRepair(), read(), runTextIO(), and write().

ASCString ContainerBaseType::name
int ContainerBaseType::nominalresearchpoints
vector<IntRange> ContainerBaseType::objectGroupsHarvestable

the group-ids of objects this unit can construct

Definition at line 251 of file containerbasetype.h.

vector<IntRange> ContainerBaseType::objectsHarvestable

the ids of objects this unit can construct

Definition at line 248 of file containerbasetype.h.

Resources ContainerBaseType::productionCost
ResourceMatrix ContainerBaseType::productionEfficiency
int ContainerBaseType::range

Definition at line 243 of file containerbasetype.h.

vector<int> ContainerBaseType::secondaryIDs

when loading a file and these IDs are encountered, this object will be used.

Definition at line 93 of file containerbasetype.h.

Referenced by read(), runTextIO(), and write().

TechAdapterDependency ContainerBaseType::techDependency
int ContainerBaseType::vehicleCategoriesProduceable

bitmapped: vehicle categories that can be produced in the container

Definition at line 135 of file containerbasetype.h.

Referenced by ContainerBaseType(), evaluateProduction(), ProductionItemFactory::isFiltered(), BuildProductionLineCommand::productionLinesBuyable(), read(), runTextIO(), and write().

int ContainerBaseType::vehicleCategoriesStorable

bitmapped: vehicle categories that can be stored the container

Definition at line 132 of file containerbasetype.h.

Referenced by ContainerBaseType(), read(), runTextIO(), CargoDialog::userHandler(), vehicleFit(), and write().

vector<IntRange> ContainerBaseType::vehiclesInternallyProduceable

the default production capabilities of this container.

Please be aware that a VehicleType has additional production for building units externally

Definition at line 139 of file containerbasetype.h.

Referenced by ContainerBase::ContainerBase(), read(), runTextIO(), and write().

int ContainerBaseType::view

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