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

VehicleService Class Reference

#include <unitctrl.h>

Inheritance diagram for VehicleService:

Inheritance graph
[legend]
List of all members.

Public Types

typedef map< int, TargetTargetContainer
enum  Service { srv_repair, srv_resource, srv_ammo }

Public Member Functions

VehiclegetVehicle (void)
BuildinggetBuilding (void)
int getStatus (void)
virtual int available (Vehicle *veh) const
int execute (Vehicle *veh, int targetNWID, int dummy, int step, int pos, int amount)
int fillEverything (int targetNWID, bool repairsToo)
virtual void registerPVA (VehicleActionType _actionType, PPendingVehicleActions _pva)
 VehicleService (MapDisplayInterface *md, PPendingVehicleActions _pva=NULL)
virtual ~VehicleService ()

Static Public Member Functions

static int avail (const Vehicle *veh)
static int getServices (Vehicle *veh)

Public Attributes

VehicleService::FieldSearch fieldSearch
TargetContainer dest
int guimode
 here the gui stores which icon initiated the service; thus preventing the occurance of an repair icon when a fuel transfer was initiated.

Protected Attributes

MapDisplayInterfacemapDisplay

Classes

class  FieldSearch
class  Target

Member Typedef Documentation

typedef map<int,Target> VehicleService::TargetContainer
 

Definition at line 338 of file unitctrl.h.


Member Enumeration Documentation

enum VehicleService::Service
 

Enumeration values:
srv_repair 
srv_resource 
srv_ammo 

Definition at line 321 of file unitctrl.h.


Constructor & Destructor Documentation

VehicleService::VehicleService MapDisplayInterface md,
PPendingVehicleActions  _pva = NULL
 

Definition at line 1233 of file unitctrl.cpp.

References guimode, mapDisplay, VehicleAction::pva, and PendingVehicleActions::service.

VehicleService::~VehicleService  )  [virtual]
 

Definition at line 1772 of file unitctrl.cpp.

References VehicleAction::pva, and PendingVehicleActions::service.


Member Function Documentation

int VehicleService::avail const Vehicle veh  )  [static]
 

Definition at line 1246 of file unitctrl.cpp.

References SingleWeapon::canRefuel(), ContainerBaseType::ExternalEnergyTransfer, ContainerBaseType::ExternalFuelTransfer, ContainerBaseType::ExternalMaterialTransfer, ContainerBaseType::ExternalRepair, Vehicle::ReactionFire::off, SingleWeapon::service(), UnitWeapon::weapon, and Vehicletype::weapons.

Referenced by available(), and GuiFunctions::RepairUnit::available().

int VehicleService::available Vehicle veh  )  const [virtual]
 

Implements VehicleAction.

Definition at line 1283 of file unitctrl.cpp.

References avail().

int VehicleService::execute Vehicle veh,
int  targetNWID,
int  dummy,
int  step,
int  pos,
int  amount
[virtual]
 

Implements VehicleAction.

Definition at line 1630 of file unitctrl.cpp.

References Building::ammo, Vehicle::ammo, VehicleService::Target::Service::curAmount, VehicleService::Target::dest, dest, fatalError(), fieldSearch, Building::getEntry(), getfield(), Building::getResource(), VehicleService::FieldSearch::init(), logtoreplayinfo(), VehicleService::Target::Service::maxAmount, Vehicle::networkid, ContainerControls::produceAmmo(), Vehicle::putResource(), ContainerBase::repairItem(), rpl_bldrefuel, rpl_refuel, rpl_refuel2, rpl_repairUnit, VehicleService::FieldSearch::run(), VehicleService::Target::service, VehicleService::Target::Service::sourcePos, srv_ammo, srv_repair, srv_resource, VehicleService::Target::Service::targetPos, VehicleService::Target::Service::type, MapCoordinate::x, Vehicle::xpos, MapCoordinate::y, and Vehicle::ypos.

Referenced by GuiFunctions::RepairUnit::execute(), and fillEverything().

int VehicleService::fillEverything int  targetNWID,
bool  repairsToo
 

Definition at line 1736 of file unitctrl.cpp.

References dest, execute(), VehicleService::Target::service, srv_ammo, srv_repair, and srv_resource.

Building* VehicleService::getBuilding void   )  [inline]
 

Definition at line 319 of file unitctrl.h.

int VehicleService::getServices Vehicle veh  )  [static]
 

Definition at line 1288 of file unitctrl.cpp.

References Vehicle::attacked, SingleWeapon::canRefuel(), Vehicle::canRepair(), ContainerBaseType::ExternalEnergyTransfer, ContainerBaseType::ExternalFuelTransfer, ContainerBaseType::ExternalMaterialTransfer, ContainerBaseType::ExternalRepair, ContainerBase::getStorageCapacity(), ContainerBaseType::hasFunction(), SingleWeapon::service(), srv_ammo, srv_repair, srv_resource, Vehicle::typ, UnitWeapon::weapon, and Vehicletype::weapons.

Referenced by GuiFunctions::RepairUnit::available().

int VehicleService::getStatus void   )  [inline, virtual]
 

Implements VehicleAction.

Definition at line 341 of file unitctrl.h.

Vehicle* VehicleService::getVehicle void   )  [inline]
 

Definition at line 318 of file unitctrl.h.

Referenced by GuiFunctions::RepairUnit::getName().

void VehicleService::registerPVA VehicleActionType  _actionType,
PPendingVehicleActions  _pva
[virtual]
 

Reimplemented from VehicleAction.

Definition at line 1764 of file unitctrl.cpp.

References VehicleAction::pva, VehicleAction::registerPVA(), and PendingVehicleActions::service.


Member Data Documentation

TargetContainer VehicleService::dest
 

Definition at line 339 of file unitctrl.h.

Referenced by GuiFunctions::RepairUnit::available(), VehicleService::FieldSearch::checkBuilding2Vehicle(), VehicleService::FieldSearch::checkVehicle2Vehicle(), execute(), GuiFunctions::RepairUnit::execute(), and fillEverything().

VehicleService::FieldSearch VehicleService::fieldSearch
 

Referenced by execute().

int VehicleService::guimode
 

here the gui stores which icon initiated the service; thus preventing the occurance of an repair icon when a fuel transfer was initiated.

Definition at line 352 of file unitctrl.h.

Referenced by GuiFunctions::RepairUnit::available(), GuiFunctions::RepairUnit::execute(), and VehicleService().

MapDisplayInterface* VehicleService::mapDisplay [protected]
 

Definition at line 316 of file unitctrl.h.

Referenced by VehicleService().


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