WeaponRandomChoice Class Reference

#include <WeaponRandomChoice.h>

Inheritance diagram for WeaponRandomChoice:

Weapon AccessoryPart

List of all members.

Public Member Functions

 WeaponRandomChoice ()
virtual ~WeaponRandomChoice ()
virtual bool parseXML (AccessoryCreateContext &context, XMLNode *accessoryNode)
void fireWeapon (ScorchedContext &context, WeaponFireContext &weaponContext, FixedVector &position, FixedVector &velocity)
 REGISTER_ACCESSORY_HEADER (WeaponRandomChoice, AccessoryPart::AccessoryWeapon)

Protected Attributes

int totalWeight_
std::list< WeaponWeightweaponsChoice_

Classes

struct  WeaponWeight


Detailed Description

Definition at line 27 of file WeaponRandomChoice.h.


Constructor & Destructor Documentation

WeaponRandomChoice::WeaponRandomChoice (  ) 

Definition at line 29 of file WeaponRandomChoice.cpp.

WeaponRandomChoice::~WeaponRandomChoice (  )  [virtual]

Definition at line 34 of file WeaponRandomChoice.cpp.


Member Function Documentation

bool WeaponRandomChoice::parseXML ( AccessoryCreateContext context,
XMLNode accessoryNode 
) [virtual]

Reimplemented from Weapon.

Definition at line 38 of file WeaponRandomChoice.cpp.

References AccessoryPart::AccessoryWeapon, XMLNode::failChildren(), AccessoryCreateContext::getAccessoryStore(), XMLNode::getNamedChild(), AccessoryPart::getType(), AccessoryPart::parent_, Weapon::parseXML(), XMLNode::returnError(), snprintf, totalWeight_, and weaponsChoice_.

void WeaponRandomChoice::fireWeapon ( ScorchedContext context,
WeaponFireContext weaponContext,
FixedVector position,
FixedVector velocity 
) [virtual]

Implements Weapon.

Definition at line 84 of file WeaponRandomChoice.cpp.

References Weapon::fireWeapon(), ScorchedContext::getActionController(), ActionController::getRandom(), RandomGenerator::getRandUInt(), totalWeight_, WeaponRandomChoice::WeaponWeight::weapon, weaponsChoice_, and WeaponRandomChoice::WeaponWeight::weight.

WeaponRandomChoice::REGISTER_ACCESSORY_HEADER ( WeaponRandomChoice  ,
AccessoryPart::AccessoryWeapon   
)


Member Data Documentation

int WeaponRandomChoice::totalWeight_ [protected]

Definition at line 49 of file WeaponRandomChoice.h.

Referenced by fireWeapon(), and parseXML().

std::list<WeaponWeight> WeaponRandomChoice::weaponsChoice_ [protected]

Definition at line 50 of file WeaponRandomChoice.h.

Referenced by fireWeapon(), and parseXML().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:08 2009 for Scorched3D by  doxygen 1.5.3