Advanced Strategic Command
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SingleWeapon Class Reference

A single weapon of a #Vehicletype. More...

#include <vehicletype.h>

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

Member Function Documentation

bool SingleWeapon::canRefuel ( void  ) const
bool SingleWeapon::equals ( const SingleWeapon otherWeapon) const
ASCString SingleWeapon::getIconFileName ( int  weaponType)
static
ASCString SingleWeapon::getName ( void  ) const
int SingleWeapon::getScalarWeaponType ( void  ) const
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
bool SingleWeapon::placeObjects ( ) const

Definition at line 865 of file vehicletype.cpp.

References cwobjectplacementb, and Vehicle::typ.

Referenced by getName().

bool SingleWeapon::requiresAmmo ( void  ) const

Definition at line 842 of file vehicletype.cpp.

References cwlaserb, cwmineb, cwweapon, and Vehicle::typ.

Referenced by VehicleProduction_SelectionItemFactory::getCost().

void SingleWeapon::runTextIO ( PropertyContainer pc)
bool SingleWeapon::service ( void  ) const
void SingleWeapon::set ( int  type)

Definition at line 877 of file vehicletype.cpp.

References Vehicle::typ.

Referenced by VehicleType::read().

bool SingleWeapon::shootable ( void  ) const

Member Data Documentation

int SingleWeapon::count
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(), WeaponInfoPanel::showWeapon(), 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(), DataTab::setData(), 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(), DataTab::setData(), SingleWeapon(), and VehicleType::write().

int SingleWeapon::maxdistance
int SingleWeapon::maxstrength
int SingleWeapon::mindistance
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(), DataTab::setData(), SingleWeapon(), and VehicleType::write().

ASCString SingleWeapon::name
int SingleWeapon::reactionFireShots
ASCString SingleWeapon::soundLabel

Definition at line 147 of file vehicletype.h.

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

int SingleWeapon::sourceheight
int SingleWeapon::targ
int SingleWeapon::targetingAccuracy[cmovemalitypenum]

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