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

SingleWeapon Class Reference

A single weapon of a Vehicletype. More...

#include <vehicletype.h>

List of all members.

Public Member Functions

 SingleWeapon ()
int getScalarWeaponType (void) const
bool requiresAmmo (void) const
bool shootable (void) const
bool service (void) const
bool placeObjects () const
bool canRefuel (void) const
void set (int type)
int gettype (void) const
bool offensive (void) const
ASCString getName (void) const
void runTextIO (PropertyContainer &pc)
bool equals (const SingleWeapon *otherWeapon) const

Static Public Member Functions

static ASCString getIconFileName (int weaponType)

Public Attributes

int targ
 the weapon can attack targets at these levels of height (bitmapped)
int sourceheight
 the weapon can be shot from these levels of height (bitmapped)
int maxdistance
 the maximum distance the weapon can shoot
int mindistance
 the minimal distance the weapon can shoot
int count
 amount of ammunition the unit having this weapon can carry
int maxstrength
 strength of the weapon when fired over the minimal distance
int minstrength
 strength of the weapon when fired over the maximum distance
int efficiency [13]
 the targeting accuracy of the weapon over different height differences between the attacking unit and the target.
int targetingAccuracy [cmovemalitypenum]
 the effectiveness of the weapon against different targets.
int laserRechargeRate
 the number of shots that the laser is recharged each turn
Resources laserRechargeCost
 the resources that recharging the laser for a single shot requires
int reactionFireShots
ASCString soundLabel
ASCString name


Detailed Description

A single weapon of a Vehicletype.

Definition at line 100 of file vehicletype.h.


Constructor & Destructor Documentation

SingleWeapon::SingleWeapon  ) 
 

Definition at line 785 of file vehicletype.cpp.

References cmovemalitypenum, count, efficiency, laserRechargeRate, maxdistance, maxstrength, mindistance, minstrength, reactionFireShots, sourceheight, targ, and targetingAccuracy.


Member Function Documentation

bool SingleWeapon::canRefuel void   )  const
 

Definition at line 846 of file vehicletype.cpp.

References cwammunitionb.

Referenced by assignWeaponInfo(), VehicleService::avail(), Vehicletype::calcProductionsCost(), VehicleService::FieldSearch::checkVehicle2Vehicle(), Vehicle::getAmmo(), VehicleService::getServices(), VehicleService::FieldSearch::initrefuelling(), internalAmmoTransferAvailable(), InternalAmmoTransferHandler::InternalAmmoTransferHandler(), InternalAmmoTransferHandler::performTransfer(), Vehicletype::read(), and Vehicletype::runTextIO().

bool SingleWeapon::equals const SingleWeapon otherWeapon  )  const
 

Definition at line 905 of file vehicletype.cpp.

References count, efficiency, gettype(), maxdistance, maxstrength, mindistance, minstrength, sourceheight, and targ.

Referenced by internalAmmoTransferAvailable(), and InternalAmmoTransferHandler::InternalAmmoTransferHandler().

ASCString SingleWeapon::getIconFileName int  weaponType  )  [static]
 

Definition at line 876 of file vehicletype.cpp.

References cwbombn, cwcannonn, cwcruisemissile, cwlargemissilen, cwlasern, cwmachinegunn, cwminen, cwservicen, cwsmallmissilen, and cwtorpedon.

Referenced by assignWeaponInfo(), WeaponInfoLine::painter(), DashboardPanel::painter(), AttackPanel::painter(), and WeaponInfoPanel::showWeapon().

ASCString SingleWeapon::getName void   )  const
 

Definition at line 857 of file vehicletype.cpp.

References cwaffentypen, cwservicen, getScalarWeaponType(), name, placeObjects(), and service().

Referenced by assignWeaponInfo().

int SingleWeapon::getScalarWeaponType void   )  const
 

Definition at line 808 of file vehicletype.cpp.

References cwmineb, cwweapon, and log2().

Referenced by assignWeaponInfo(), attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), Vehicletype::calcProductionsCost(), VehicleService::FieldSearch::checkVehicle2Vehicle(), Vehicle::getAmmo(), VehicleProduction_SelectionItemFactory::getCost(), getName(), WeapDist::getWeaponStrength(), tputmine::initpm(), InternalAmmoTransferHandler::InternalAmmoTransferHandler(), Vehicle::maxAmmo(), WeaponInfoLine::painter(), DashboardPanel::painter(), InternalAmmoTransferHandler::performTransfer(), Vehicle::putAmmo(), putMine(), tunitattacksobject::setup(), tunitattacksbuilding::setup(), tunitattacksunit::setup(), DashboardPanel::showUnitData(), and WeaponInfoPanel::WeaponInfoPanel().

int SingleWeapon::gettype void   )  const [inline]
 

Definition at line 158 of file vehicletype.h.

Referenced by Vehicle::endOwnTurn(), equals(), and Vehicletype::write().

bool SingleWeapon::offensive void   )  const
 

Definition at line 830 of file vehicletype.cpp.

References cwweapon.

Referenced by attackpossible28(), attackpossible2n(), attackpossible2u(), CalculateThreat_VehicleType::calc_threat_vehicletype(), and Vehicle::weapexist().

bool SingleWeapon::placeObjects  )  const
 

Definition at line 840 of file vehicletype.cpp.

References cwobjectplacementb.

Referenced by getName().

bool SingleWeapon::requiresAmmo void   )  const
 

Definition at line 817 of file vehicletype.cpp.

References cwlaserb, cwmineb, and cwweapon.

Referenced by CargoGuiFunctions::RefuelUnitDialog::available(), CargoGuiFunctions::RefuelUnit::available(), VehicleService::FieldSearch::checkVehicle2Vehicle(), ContainerControls::emptyeverything(), VehicleProduction_SelectionItemFactory::getCost(), and ContainerControls::refillAmmo().

void SingleWeapon::runTextIO PropertyContainer pc  ) 
 

Definition at line 1207 of file vehicletype.cpp.

References PropertyContainer::addInteger(), PropertyContainer::addString(), PropertyContainer::addTagInteger(), choehenstufennum, PropertyContainer::closeBracket(), cmovemalitypenum, count, cwaffentypennum, efficiency, PropertyContainer::find(), heightTags, PropertyContainer::isReading(), laserRechargeCost, laserRechargeRate, maxdistance, maxstrength, mindistance, minstrength, name, PropertyContainer::openBracket(), reactionFireShots, Resources::runTextIO(), soundLabel, sourceheight, strrr(), targ, targetingAccuracy, unitCategoryTags, and weaponTags.

Referenced by Vehicletype::runTextIO().

bool SingleWeapon::service void   )  const
 

Definition at line 835 of file vehicletype.cpp.

References cwserviceb.

Referenced by assignWeaponInfo(), VehicleService::avail(), Vehicletype::calcProductionsCost(), VehicleService::FieldSearch::checkVehicle2Vehicle(), getName(), VehicleService::getServices(), ServiceChecker::getServiceWeapon(), VehicleService::FieldSearch::initrefuelling(), DashboardPanel::painter(), Vehicletype::runTextIO(), and DashboardPanel::showUnitData().

void SingleWeapon::set int  type  ) 
 

Definition at line 852 of file vehicletype.cpp.

Referenced by Vehicletype::read().

bool SingleWeapon::shootable void   )  const
 

Definition at line 825 of file vehicletype.cpp.

References cwshootableb.

Referenced by assignWeaponInfo(), attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), CalculateThreat_VehicleType::calc_threat_vehicletype(), Vehicletype::calcProductionsCost(), Vehicle::ReactionFire::enable(), VehicleAttack::execute(), tputmine::initpm(), Vehicle::putAmmo(), putMine(), WeaponRange::run(), DashboardPanel::showUnitData(), and Vehicle::weapexist().


Member Data Documentation

int SingleWeapon::count
 

amount of ammunition the unit having this weapon can carry

Definition at line 117 of file vehicletype.h.

Referenced by assignWeaponInfo(), CargoGuiFunctions::RefuelUnit::available(), VehicleService::FieldSearch::checkBuilding2Vehicle(), VehicleService::FieldSearch::checkVehicle2Vehicle(), Vehicle::endOwnTurn(), equals(), Vehicle::fillMagically(), VehicleProduction_SelectionItemFactory::getCost(), UnitPropertyEditor::init(), Vehicle::maxAmmo(), InternalAmmoTransferHandler::performTransfer(), Vehicle::putAmmo(), Vehicletype::read(), runTextIO(), DashboardPanel::showUnitData(), SingleWeapon(), Vehicle::transform(), Vehicletype::write(), and Vehicle::write().

int SingleWeapon::efficiency[13]
 

the targeting accuracy of the weapon over different height differences between the attacking unit and the target.

The levels "ground" and "floating" are assumed to be the same. All values are in percent. The index for this array is the height difference+6 Example: low flying airplane attacking a submerged submarine: height difference is -2 ; index here is 4

Definition at line 132 of file vehicletype.h.

Referenced by attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), equals(), WeapDist::getWeaponStrength(), Vehicletype::read(), runTextIO(), SingleWeapon(), and Vehicletype::write().

Resources SingleWeapon::laserRechargeCost
 

the resources that recharging the laser for a single shot requires

Definition at line 143 of file vehicletype.h.

Referenced by Vehicle::endOwnTurn(), Vehicletype::read(), runTextIO(), and Vehicletype::write().

int SingleWeapon::laserRechargeRate
 

the number of shots that the laser is recharged each turn

Definition at line 140 of file vehicletype.h.

Referenced by Vehicletype::read(), runTextIO(), SingleWeapon(), and Vehicletype::write().

int SingleWeapon::maxdistance
 

the maximum distance the weapon can shoot

Definition at line 111 of file vehicletype.h.

Referenced by assignWeaponInfo(), Vehicletype::calcProductionsCost(), equals(), WeapDist::getWeaponStrength(), tputmine::initpm(), VehicleService::FieldSearch::initrefuelling(), Vehicletype::read(), WeaponRange::run(), runTextIO(), SingleWeapon(), ServiceTargetSearcher::startSearch(), and Vehicletype::write().

int SingleWeapon::maxstrength
 

strength of the weapon when fired over the minimal distance

Definition at line 120 of file vehicletype.h.

Referenced by assignWeaponInfo(), CalculateThreat_VehicleType::calc_threat_vehicletype(), Vehicletype::calcProductionsCost(), equals(), Vehicle::fillMagically(), WeapDist::getWeaponStrength(), Vehicletype::read(), runTextIO(), DashboardPanel::showUnitData(), SingleWeapon(), Vehicle::transform(), Vehicletype::write(), and Vehicle::write().

int SingleWeapon::mindistance
 

the minimal distance the weapon can shoot

Definition at line 114 of file vehicletype.h.

Referenced by assignWeaponInfo(), attackpossible(), attackpossible28(), attackpossible2n(), CalculateThreat_VehicleType::calc_threat_vehicletype(), equals(), WeapDist::getWeaponStrength(), tputmine::initpm(), VehicleService::FieldSearch::initrefuelling(), Vehicletype::read(), WeaponRange::run(), runTextIO(), SingleWeapon(), ServiceTargetSearcher::startSearch(), and Vehicletype::write().

int SingleWeapon::minstrength
 

strength of the weapon when fired over the maximum distance

Definition at line 123 of file vehicletype.h.

Referenced by assignWeaponInfo(), equals(), WeapDist::getWeaponStrength(), Vehicletype::read(), runTextIO(), SingleWeapon(), and Vehicletype::write().

ASCString SingleWeapon::name
 

Definition at line 149 of file vehicletype.h.

Referenced by getName(), Vehicletype::read(), runTextIO(), and Vehicletype::write().

int SingleWeapon::reactionFireShots
 

Definition at line 145 of file vehicletype.h.

Referenced by assignWeaponInfo(), Vehicletype::calcProductionsCost(), Vehicle::ReactionFire::checkData(), Vehicletype::read(), runTextIO(), Vehicletype::runTextIO(), DashboardPanel::showUnitData(), SingleWeapon(), and Vehicletype::write().

ASCString SingleWeapon::soundLabel
 

Definition at line 147 of file vehicletype.h.

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

int SingleWeapon::sourceheight
 

the weapon can be shot from these levels of height (bitmapped)

Definition at line 108 of file vehicletype.h.

Referenced by assignWeaponInfo(), attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), CalculateThreat_VehicleType::calc_threat_vehicletype(), Vehicle::ReactionFire::enable(), equals(), VehicleAttack::execute(), tputmine::initpm(), WeaponInfoLine::painter(), Vehicletype::read(), runTextIO(), SingleWeapon(), and Vehicletype::write().

int SingleWeapon::targ
 

the weapon can attack targets at these levels of height (bitmapped)

Definition at line 105 of file vehicletype.h.

Referenced by assignWeaponInfo(), attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), CalculateThreat_VehicleType::calc_threat_vehicletype(), equals(), WeaponInfoLine::painter(), Vehicletype::read(), runTextIO(), SingleWeapon(), and Vehicletype::write().

int SingleWeapon::targetingAccuracy[cmovemalitypenum]
 

the effectiveness of the weapon against different targets.

All values are in percent.

See also:
cmovemalitypes

Definition at line 137 of file vehicletype.h.

Referenced by attackpossible(), attackpossible28(), attackpossible2n(), attackpossible2u(), Vehicletype::read(), runTextIO(), tunitattacksobject::setup(), tunitattacksbuilding::setup(), tunitattacksunit::setup(), SingleWeapon(), and Vehicletype::write().


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