#include <WeaponRandomChoice.h>

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< WeaponWeight > | weaponsChoice_ |
Classes | |
| struct | WeaponWeight |
Definition at line 27 of file WeaponRandomChoice.h.
| WeaponRandomChoice::WeaponRandomChoice | ( | ) |
Definition at line 29 of file WeaponRandomChoice.cpp.
| WeaponRandomChoice::~WeaponRandomChoice | ( | ) | [virtual] |
Definition at line 34 of file WeaponRandomChoice.cpp.
| 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 | ||||
| ) |
int WeaponRandomChoice::totalWeight_ [protected] |
std::list<WeaponWeight> WeaponRandomChoice::weaponsChoice_ [protected] |
1.5.3