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

ContainerBase Class Reference

The parent class of Vehicle and Building; The name Container originates from Battle Isle, where everything that could load units was a container. More...

#include <containerbase.h>

Inheritance diagram for ContainerBase:

Inheritance graph
[legend]
List of all members.

Cargo related functions

typedef vector< Vehicle * > Cargo
const CargogetCargo () const
void clearCargo ()
 removes ALL units from cargo
virtual int getArmor () const =0
void addToCargo (Vehicle *veh)
bool removeUnitFromCargo (Vehicle *veh, bool recursive=false)
 removes the given unit from the container. true of the unit was found, false otherwise
bool removeUnitFromCargo (int nwid, bool recursive=false)
bool unitLoaded (int nwid)
int vehiclesLoaded (void) const
 returns the number of loaded units
ContainerBasegetCarrier () const
 if this is a unit and it is inside a building or transport, returns the transport. NULL otherwise.
VehiclefindUnit (int nwid) const
 searches for a the unit in the whole stack
bool vehicleLoadable (const Vehicle *vehicle, int uheight=-1, const bool *attacked=NULL) const
 can the vehicle be loaded.
int vehicleUnloadable (const Vehicletype *vehicleType) const
 returns the levels of height on which this unit can be unloaded; or 0 if no unloading is possible
const ContainerBaseType::TransportationIOvehicleUnloadSystem (const Vehicletype *vehicle, int height)
 returns the unloading system
int vehicleDocking (const Vehicle *vehicle, bool out) const
 returns the levels of height on which this unit can be transfered by docking; or 0 if no unloading is possible
bool vehicleFit (const Vehicle *vehicle) const
 Does the vehicle fit into the container? This does not include checking if it can reach the entry.
int cargoWeight () const
 weight of all loaded units
int cargoNestingDepth ()
 returns the nesting depth of the cargo. The unit standing on the field is 0, its cargo is 1, the cargo's cargo 2 ...
SigC::Signal0< void > cargoChanged
Cargo cargo

Resource related functions

virtual int putResource (int amount, int resourcetype, bool queryonly, int scope=1, int player=-1)=0
 scope: 0 = local 1 = resource network 2 = global in all buildings 3 = map wide pool( used only internally! )
virtual int getResource (int amount, int resourcetype, bool queryonly, int scope=1, int player=-1)=0
virtual int getAvailableResource (int amount, int resourcetype, int scope=1) const =0
Resources putResource (const Resources &res, bool queryonly, int scope=1, int player=-1)
Resources getResource (const Resources &res, bool queryonly, int scope=1, int player=-1)
Resources getResource (const Resources &res) const
Resources getResourceUsage ()
 returns the resource that the building consumes for its operation.
Resources getResourcePlus ()
Resources getStorageCapacity () const
 returns the local storage capacity for the given resource, which depends on the resource mode of the map.
Resources netResourcePlus () const
 returns the amount of resources that the net which the building is connected to produces each turn
Resources plus
 the Resources that are produced each turn
Resources maxplus
 the maximum amount of Resources that the building can produce each turn in the ASC resource mode ; see also bi_resourceplus
Resources bi_resourceplus
 the maximum amount of Resources that the building can produce each turn in the BI resource mode ; see also maxplus

Public Types

typedef vector< const Vehicletype * > Production

Public Member Functions

virtual bool isBuilding () const =0
virtual Surface getImage () const =0
const ProductiongetProduction () const
Resources getProductionCost (const Vehicletype *unit) const
void deleteProductionLine (const Vehicletype *type)
void deleteAllProductionLines ()
void addProductionLine (const Vehicletype *type)
void setProductionLines (const Production &production)
int getOwner () const
 returns the player this vehicle/building belongs to
PlayergetOwningPlayer () const
virtual void convert (int player)=0
virtual void write (tnstream &stream, bool includeLoadedUnits=true)=0
virtual void read (tnstream &stream)=0
virtual void addview (void)=0
virtual void removeview (void)=0
virtual bool canRepair (const ContainerBase *item) const =0
int getMaxRepair (const ContainerBase *item)
int getMaxRepair (const ContainerBase *item, int newDamage, Resources &cost, bool ignoreCost=false)
int repairItem (ContainerBase *item, int newDamage=0)
virtual int repairableDamage ()=0
 returns the amount of damate that can still be repaired this turn
GameMapgetMap () const
virtual int getIdentification ()=0
virtual int getHeight () const =0
 returns the bitmapped level of height. Only one bit will be set, of course
virtual ASCString getName () const =0
virtual int getAmmo (int type, int num, bool queryOnly)=0
virtual int getAmmo (int type, int num) const =0
virtual int putAmmo (int type, int num, bool queryOnly)=0
virtual int maxAmmo (int type) const =0
virtual void endOwnTurn (void)
 hook that is called when a player ends his turn
virtual void endAnyTurn (void)
 hook that is called when any player (including owner) ends turn
virtual void endRound (void)
 hook that is called the next round begins ( active player switching from player8 to player1 )
WorkspawnWorkClasses (bool justQuery)
virtual MapCoordinate3D getPosition () const =0
virtual ~ContainerBase ()
virtual vector< MapCoordinategetCoveredFields ()=0

Static Public Member Functions

static int calcShadowDist (int binaryHeight)
static bool registerWorkClassFactory (WorkClassFactory *wcf, bool ASCmode=true)

Public Attributes

const ContainerBaseTypebaseType
int damage
int color
SigC::Signal0< void > conquered
SigC::Signal0< void > destroyed
int researchpoints
 the current amount of research that the building conducts every turn
int maxresearchpoints

Static Public Attributes

static SigC::Signal1< void,
ContainerBase * > 
anyContainerDestroyed
static SigC::Signal1< void,
ContainerBase * > 
anyContainerConquered

Protected Member Functions

virtual const ResourceMatrixgetRepairEfficiency (void)=0
virtual void postRepair (int oldDamage)=0
 is called after a repair is perfored. Vehicles use this to reduce their experience.
void paintField (const Surface &src, Surface &dest, SPoint pos, int dir, bool shaded, int shadowDist=-1) const
 ContainerBase (const ContainerBaseType *bt, GameMap *map, int player)

Protected Attributes

GameMapgamemap
ContainerBasecargoParent
Production internalUnitProduction

Classes

class  Work
class  WorkClassFactory

Detailed Description

The parent class of Vehicle and Building; The name Container originates from Battle Isle, where everything that could load units was a container.

Definition at line 41 of file containerbase.h.


Member Typedef Documentation

typedef vector<Vehicle*> ContainerBase::Cargo
 

Definition at line 79 of file containerbase.h.

typedef vector<const Vehicletype*> ContainerBase::Production
 

Definition at line 61 of file containerbase.h.


Constructor & Destructor Documentation

ContainerBase::ContainerBase const ContainerBaseType bt,
GameMap map,
int  player
[protected]
 

Definition at line 34 of file containerbase.cpp.

References baseType, color, damage, ContainerBaseType::defaultMaxResearchpoints, GameMap::getvehicletype_bypos(), internalUnitProduction, ContainerBaseType::maxplus, maxplus, maxresearchpoints, min(), ContainerBaseType::nominalresearchpoints, researchpoints, and ContainerBaseType::vehiclesInternallyProduceable.

ContainerBase::~ContainerBase  )  [virtual]
 

Definition at line 556 of file containerbase.cpp.

References anyContainerDestroyed, cargo, destroyed, GameMap::Destruction, gamemap, and GameMap::state.


Member Function Documentation

void ContainerBase::addProductionLine const Vehicletype type  ) 
 

Definition at line 542 of file containerbase.cpp.

References internalUnitProduction.

Referenced by ContainerControls::buildProductionLine(), and AddProductionCapability::execute().

void ContainerBase::addToCargo Vehicle veh  ) 
 

Definition at line 339 of file containerbase.cpp.

References cargo, cargoChanged, cargoParent, and getPosition().

Referenced by copyBuildingData(), copyVehicleData(), trunreplay::execnextreplaymove(), CargoItemFactory::itemSelected(), ContainerControls::moveUnitDown(), BaseVehicleMovement::moveunitxy(), and ContainerControls::produceUnit().

virtual void ContainerBase::addview void   )  [pure virtual]
 

Implemented in Building, and Vehicle.

int ContainerBase::calcShadowDist int  binaryHeight  )  [static]
 

Definition at line 244 of file containerbase.cpp.

References chfahrend, and log2().

Referenced by MapDisplayPG::displayAddons(), MapDisplayPG::displayUnitMovement(), and paintField().

virtual bool ContainerBase::canRepair const ContainerBase item  )  const [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by getMaxRepair(), and repairItem().

int ContainerBase::cargoNestingDepth  ) 
 

returns the nesting depth of the cargo. The unit standing on the field is 0, its cargo is 1, the cargo's cargo 2 ...

Definition at line 169 of file containerbase.cpp.

References cargoNestingDepth(), and getCarrier().

Referenced by cargoNestingDepth(), and Vehicle::setMovement().

int ContainerBase::cargoWeight  )  const
 

weight of all loaded units

Definition at line 158 of file containerbase.cpp.

References cargo.

Referenced by execuseraction2(), and Vehicle::weight().

void ContainerBase::clearCargo  ) 
 

removes ALL units from cargo

Definition at line 327 of file containerbase.cpp.

References cargo, and cargoChanged.

Referenced by TemporaryContainerStorage::restore().

virtual void ContainerBase::convert int  player  )  [pure virtual]
 

Implemented in Building, and Vehicle.

void ContainerBase::deleteAllProductionLines  ) 
 

Definition at line 536 of file containerbase.cpp.

References internalUnitProduction.

void ContainerBase::deleteProductionLine const Vehicletype type  ) 
 

Definition at line 530 of file containerbase.cpp.

References internalUnitProduction.

Referenced by ContainerControls::removeProductionLine().

void ContainerBase::endAnyTurn void   )  [virtual]
 

hook that is called when any player (including owner) ends turn

Reimplemented in Vehicle.

Definition at line 617 of file containerbase.cpp.

Referenced by Vehicle::endAnyTurn().

void ContainerBase::endOwnTurn void   )  [virtual]
 

hook that is called when a player ends his turn

Reimplemented in Vehicle.

Definition at line 592 of file containerbase.cpp.

References baseType, cargo, ContainerBaseType::hasFunction(), ContainerControls::refillAmmo(), ContainerBaseType::TrainingCenter, ContainerControls::trainUnit(), and ContainerControls::unitTrainingAvailable().

Referenced by Vehicle::endOwnTurn().

void ContainerBase::endRound void   )  [virtual]
 

hook that is called the next round begins ( active player switching from player8 to player1 )

Reimplemented in Building, and Vehicle.

Definition at line 621 of file containerbase.cpp.

Referenced by Vehicle::endRound(), and Building::endRound().

Vehicle * ContainerBase::findUnit int  nwid  )  const
 

searches for a the unit in the whole stack

Definition at line 202 of file containerbase.cpp.

References cargo.

Referenced by vehicleFit().

virtual int ContainerBase::getAmmo int  type,
int  num
const [pure virtual]
 

Implemented in Building, and Vehicle.

virtual int ContainerBase::getAmmo int  type,
int  num,
bool  queryOnly
[pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by ammoCounter(), ContainerControls::getammunition(), and CargoDialog::showAmmo().

virtual int ContainerBase::getArmor  )  const [pure virtual]
 

Implemented in Building, and Vehicle.

virtual int ContainerBase::getAvailableResource int  amount,
int  resourcetype,
int  scope = 1
const [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by ammoCounter(), getResource(), and ContainerConstControls::unitProductionPrerequisites().

const Cargo& ContainerBase::getCargo  )  const [inline]
 

Definition at line 84 of file containerbase.h.

References cargo.

Referenced by ammoCounter(), CalculateThreat_Vehicle::calc_threat_vehicle(), VehicleCounterFactory::calcCargoSummary(), ContainerControls::calcDestructionOutput(), copyVehicleData(), AnyUnitEntersPolygon::fieldOperator(), Vehicle::freeWeight(), CargoWidget::getMarkedUnit(), getUnitResourceCargo(), ContainerControls::moveUnitDownTargets(), UnitTypeTransformation::run(), StoringPosition::setup(), ServiceTargetSearcher::startSearch(), and VehicleService::FieldSearch::testfield().

ContainerBase * ContainerBase::getCarrier  )  const
 

if this is a unit and it is inside a building or transport, returns the transport. NULL otherwise.

Definition at line 180 of file containerbase.cpp.

References cargoParent.

Referenced by Vehicle::ReactionFire::canPerformAttack(), cargoNestingDepth(), ContainerControls::moveUnitUpAvail(), AutoHarvestObjects::run(), and Vehicle::~Vehicle().

virtual vector<MapCoordinate> ContainerBase::getCoveredFields  )  [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by SolarPowerplant::getPlus().

virtual int ContainerBase::getHeight  )  const [pure virtual]
 

returns the bitmapped level of height. Only one bit will be set, of course

Implemented in Building, and Vehicle.

Referenced by ServiceChecker::check(), getheightdelta(), and paintField().

virtual int ContainerBase::getIdentification  )  [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by ContainerControls::buildProductionLine(), ContainerControls::destructUnit(), ContainerControls::fillResource(), and ContainerControls::removeProductionLine().

virtual Surface ContainerBase::getImage  )  const [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by AmmoTransferWindow::AmmoTransferWindow().

GameMap* ContainerBase::getMap void   )  const [inline]
 

Definition at line 213 of file containerbase.h.

References gamemap.

Referenced by tsearchreactionfireingunits::attack(), Mine::attacksunit(), ServiceTargetSearcher::available(), SelfDestruct::available(), GuiFunctions::InternalAmmoTransferDialog::available(), CargoGuiFunctions::RecycleUnit::available(), CargoGuiFunctions::OpenContainer::available(), CargoGuiFunctions::TransferUnitControl::available(), CargoGuiFunctions::Movement::available(), VehicleCounterFactory::calcCargoSummary(), UnitHooveringLogic::calcFuelUsage(), calcMoveMalus(), Vehicle::ReactionFire::canPerformAttack(), ServiceChecker::check(), compareMapResources(), DashboardPanel::containerRenamed(), MapDisplayPG::displayMovementStep(), CargoGuiFunctions::TransferUnitControl::execute(), fieldAccessible(), JumpDrive::fieldReachable(), fieldvisiblenow(), Building::getAvailableResource(), VehicleProduction_SelectionItemFactory::getCost(), JumpDrive::getFields(), CargoDialog::getMap(), getOwningPlayer(), SolarPowerplant::getPlus(), WindPowerplant::getPlus(), Vehicle::getResource(), Building::getResource(), getTransferLimitation(), tcomputebuildingview::init(), tcomputevehicleview::init(), JumpDrive::jump(), netResourcePlus(), DashboardPanel::painter(), ContainerControls::productionLinesBuyable(), Vehicle::putResource(), Building::putResource(), ResearchGraph::recalc(), Building::repairableDamage(), DashboardPanel::reset(), AutoHarvestObjects::run(), ServiceTargetSearcher::ServiceTargetSearcher(), ResearchGraph::setResearch(), tunitattacksunit::setup(), spawnWorkClasses(), ServiceTargetSearcher::startSearch(), ContainerControls::trainUnit(), ContainerConstControls::unitProductionAvailable(), ContainerControls::unitTrainingAvailable(), vehicleFit(), vehicleLoadable(), WindMovement::WindMovement(), and Vehicle::~Vehicle().

int ContainerBase::getMaxRepair const ContainerBase item,
int  newDamage,
Resources cost,
bool  ignoreCost = false
 

Definition at line 108 of file containerbase.cpp.

References baseType, canRepair(), damage, getRepairEfficiency(), getResource(), ContainerBaseType::productionCost, repairableDamage(), Resources::resource(), and resourceTypeNum.

int ContainerBase::getMaxRepair const ContainerBase item  ) 
 

Definition at line 102 of file containerbase.cpp.

Referenced by VehicleService::FieldSearch::checkBuilding2Vehicle(), VehicleService::FieldSearch::checkVehicle2Vehicle(), and repairItem().

virtual ASCString ContainerBase::getName  )  const [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by CargoDialog::CargoDialog().

int ContainerBase::getOwner  )  const [inline]
 

returns the player this vehicle/building belongs to

Definition at line 145 of file containerbase.h.

References color.

Referenced by attackpossible(), attackpossible2n(), attackpossible2u(), Mine::attacksunit(), CargoGuiFunctions::RecycleUnit::available(), CargoGuiFunctions::OpenContainer::available(), CargoGuiFunctions::TransferUnitControl::available(), CargoGuiFunctions::UnitTraining::available(), CargoGuiFunctions::Movement::available(), Vehicle::buildingconstructable(), UnitPropertyEditor::buttonpressed(), calcMoveMalus(), calcvisibilityfield(), ServiceChecker::check(), VehicleService::FieldSearch::checkBuilding2Vehicle(), GuiFunctions::ObjectBuildingGui::checkObject(), VehicleService::FieldSearch::checkVehicle2Vehicle(), DashboardPanel::containerRenamed(), Vehicle::convert(), Building::convert(), ReplayMapDisplay::displayMovingUnit(), PG_MapDisplay::displayMovingUnit(), StoringPosition::eventMouseMotion(), trunreplay::execnextreplaymove(), execuseraction2(), GuiFunctions::VehicleBuildingGui::execute(), CargoGuiFunctions::TransferUnitControl::execute(), AnyUnitEntersPolygon::fieldOperator(), JumpDrive::fieldReachable(), tunitattacksobject::getAttackingPlayer(), tunitattacksbuilding::getAttackingPlayer(), UnitAttacksSomething::getAttackingPlayer(), tmineattacksunit::getDefendingPlayer(), tunitattacksbuilding::getDefendingPlayer(), tunitattacksunit::getDefendingPlayer(), Vehicle::getResource(), UnitConquered::getState(), UnitLost::getState(), BuildingConquered::getState(), getTransferLimitation(), tcomputebuildingview::init(), tcomputevehicleview::init(), UnitPropertyEditor::init(), CargoItemFactory::isFiltered(), CargoItemFactory::itemSelected(), JumpDrive::jump(), BaseVehicleMovement::moveunitxy(), DashboardPanel::painter(), paintField(), MapRenderer::paintSingleField(), SelectionHolder::pickup(), Vehicle::putResource(), ResearchGraph::recalc(), MiningStation::run(), RegenerativePowerPlant::run(), ResourceSink::run(), MatterConverter::run(), ResearchGraph::setResearch(), tmineattacksunit::setup(), tunitattacksbuilding::setup(), tunitattacksunit::setup(), PutTribute::start(), MiningStation::testfield(), ContainerConstControls::unitProductionAvailable(), Vehicle::vehicleconstructable(), vehicleLoadable(), and viewterraininfo().

Player & ContainerBase::getOwningPlayer  )  const
 

Definition at line 639 of file containerbase.cpp.

References getMap().

Referenced by GuiFunctions::ConstructBuilding::execute(), Building::getImage(), and DashboardPanel::painter().

virtual MapCoordinate3D ContainerBase::getPosition  )  const [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by addToCargo(), ServiceTargetSearcher::available(), ServiceChecker::check(), CargoItemFactory::itemSelected(), ContainerControls::moveUnitDown(), netResourcePlus(), ContainerControls::produceAmmo(), ContainerControls::produceUnit(), ContainerControls::produceUnitHypothetically(), MiningStation::run(), AutoHarvestObjects::run(), ServiceTargetSearcher::startSearch(), ContainerControls::trainUnit(), vehicleDocking(), vehicleLoadable(), vehicleUnloadable(), and vehicleUnloadSystem().

const ContainerBase::Production & ContainerBase::getProduction  )  const
 

Definition at line 513 of file containerbase.cpp.

References baseType, ContainerBaseType::hasFunction(), internalUnitProduction, ContainerBaseType::ProduceNonLeavableUnits, and vehicleUnloadable().

Referenced by ContainerControls::buildProductionLine(), compareMapResources(), VehicleProduction_SelectionItemFactory::getOriginalItems(), ContainerControls::productionLinesBuyable(), ContainerControls::removeProductionLine(), and UnitTypeTransformation::run().

Resources ContainerBase::getProductionCost const Vehicletype unit  )  const
 

Definition at line 524 of file containerbase.cpp.

References baseType, and ContainerBaseType::productionEfficiency.

Referenced by trunreplay::execnextreplaymove(), VehicleProduction_SelectionItemFactory::getCost(), ContainerControls::produceUnit(), and ContainerConstControls::unitProductionPrerequisites().

virtual const ResourceMatrix& ContainerBase::getRepairEfficiency void   )  [protected, pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by getMaxRepair().

Resources ContainerBase::getResource const Resources res  )  const
 

Reimplemented in Vehicle.

Definition at line 72 of file containerbase.cpp.

References getAvailableResource(), Resources::resource(), and resourceNum.

Resources ContainerBase::getResource const Resources res,
bool  queryonly,
int  scope = 1,
int  player = -1
 

Reimplemented in Building, and Vehicle.

Definition at line 64 of file containerbase.cpp.

References getResource(), Resources::resource(), and resourceNum.

virtual int ContainerBase::getResource int  amount,
int  resourcetype,
bool  queryonly,
int  scope = 1,
int  player = -1
[pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by ContainerControls::ammoProducable(), ContainerControls::buildProductionLine(), ResourceTransferrable::commit(), compareMapResources(), Vehicle::endOwnTurn(), StoringPosition::eventBlit(), ContainerControls::fillResource(), getMaxRepair(), Vehicle::getResource(), getResource(), Building::getResource(), ContainerControls::produceAmmo(), ContainerControls::produceUnit(), ContainerControls::productionLinesBuyable(), VehicleProduction_SelectionWindow::reLoadAndUpdate(), ContainerControls::removeProductionLine(), repairItem(), ResourceWatch::ResourceWatch(), MiningStation::run(), ResourceSink::run(), MatterConverter::run(), CargoDialog::updateResourceDisplay(), and VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow().

Resources ContainerBase::getResourcePlus  ) 
 

Definition at line 646 of file containerbase.cpp.

References ContainerBase::Work::getPlus(), and spawnWorkClasses().

Referenced by GetResourcePlus::checkbuilding().

Resources ContainerBase::getResourceUsage  ) 
 

returns the resource that the building consumes for its operation.

Definition at line 659 of file containerbase.cpp.

References baseType, ContainerBase::Work::getUsage(), ContainerBaseType::hasFunction(), ContainerBaseType::Research, researchpoints, returnResourcenUseForResearch(), and spawnWorkClasses().

Resources ContainerBase::getStorageCapacity  )  const
 

returns the local storage capacity for the given resource, which depends on the resource mode of the map.

See also:
GameMap::_resourcemode

Definition at line 674 of file containerbase.cpp.

References GameMap::_resourcemode, baseType, gamemap, ContainerBaseType::getStorageCapacity(), and isBuilding().

Referenced by CargoGuiFunctions::RefuelUnitDialog::available(), CargoGuiFunctions::RefuelUnit::available(), ServiceChecker::check(), GetResourceCapacity::checkbuilding(), PutTribute::checkbuilding(), PutResource::checkbuilding(), VehicleService::FieldSearch::checkVehicle2Vehicle(), Vehicle::endRound(), StoringPosition::eventBlit(), Building::execnetcontrol(), Vehicle::fillMagically(), VehicleService::getServices(), UnitPropertyEditor::init(), BuildingValues::init(), CargoItemFactory::itemSelected(), Vehicle::putResource(), DashboardPanel::showUnitData(), and Vehicle::transform().

virtual bool ContainerBase::isBuilding  )  const [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by ServiceChecker::check(), getStorageCapacity(), internalAmmoTransferAvailable(), vehicleFit(), and vehicleLoadable().

virtual int ContainerBase::maxAmmo int  type  )  const [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by ServiceChecker::check(), and AmmoTransferrable::getMax().

Resources ContainerBase::netResourcePlus  )  const
 

returns the amount of resources that the net which the building is connected to produces each turn

Definition at line 627 of file containerbase.cpp.

References color, getMap(), getPosition(), ResourceChangeNet::getresource(), Resources::resource(), and resourceTypeNum.

void ContainerBase::paintField const Surface src,
Surface dest,
SPoint  pos,
int  dir,
bool  shaded,
int  shadowDist = -1
const [protected]
 

Definition at line 256 of file containerbase.cpp.

References MegaBlitter< BytesPerSourcePixel, BytesPerTargetPixel, SourceColorTransform, ColorMerger, SourcePixelSelector, TargetPixelSelector, MyColorConverter >::blit(), calcShadowDist(), chfahrend, chgetaucht, directionangle, gamemap, getHeight(), getOwner(), log2(), megaBlitter(), nullParam, and GameMap::player.

Referenced by Vehicle::paint(), and Building::paintSingleField().

virtual void ContainerBase::postRepair int  oldDamage  )  [protected, pure virtual]
 

is called after a repair is perfored. Vehicles use this to reduce their experience.

Implemented in Building, and Vehicle.

virtual int ContainerBase::putAmmo int  type,
int  num,
bool  queryOnly
[pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by ContainerControls::fillAmmo(), and ContainerControls::produceAmmo().

Resources ContainerBase::putResource const Resources res,
bool  queryonly,
int  scope = 1,
int  player = -1
 

Reimplemented in Building, and Vehicle.

Definition at line 55 of file containerbase.cpp.

References putResource(), Resources::resource(), and resourceNum.

virtual int ContainerBase::putResource int  amount,
int  resourcetype,
bool  queryonly,
int  scope = 1,
int  player = -1
[pure virtual]
 

scope: 0 = local 1 = resource network 2 = global in all buildings 3 = map wide pool( used only internally! )

Implemented in Building, and Vehicle.

Referenced by ContainerControls::destructUnit(), Vehicle::putResource(), putResource(), Building::putResource(), ResourceWatch::ResourceWatch(), MiningStation::run(), RegenerativePowerPlant::run(), and MatterConverter::run().

virtual void ContainerBase::read tnstream stream  )  [pure virtual]
 

Implemented in Building, and Vehicle.

Referenced by TemporaryContainerStorage::restore().

bool ContainerBase::registerWorkClassFactory WorkClassFactory wcf,
bool  ASCmode = true
[static]
 

Definition at line 685 of file containerbase.cpp.

bool ContainerBase::removeUnitFromCargo int  nwid,
bool  recursive = false