#include <src/orxonox/objects/weaponsystem/WeaponMode.h>
Public Member Functions | |
bool | fire (float *reloadTime) |
bool | getAutoReload () const |
float | getDamage () const |
unsigned int | getInitialMagazines () const |
unsigned int | getInitialMunition () const |
unsigned int | getMode () const |
Munition * | getMunition () const |
const std::string & | getMunitionName () const |
unsigned int | getMunitionPerShot () const |
Identifier * | getMunitionType () const |
Vector3 | getMuzzleDirection () const |
const Vector3 & | getMuzzleOffset () const |
const Quaternion & | getMuzzleOrientation () const |
Vector3 | getMuzzlePosition () const |
bool | getParallelReload () const |
float | getReloadTime () const |
Weapon * | getWeapon () const |
bool | reload () |
void | setAutoReload (bool autoreload) |
void | setDamage (float damage) |
void | setInitialMagazines (unsigned int amount) |
void | setInitialMunition (unsigned int amount) |
void | setMode (unsigned int mode) |
void | setMunitionName (const std::string &munitionname) |
void | setMunitionPerShot (unsigned int amount) |
void | setMunitionType (Identifier *identifier) |
void | setMuzzleOffset (const Vector3 &offset) |
void | setParallelReload (bool parallelreload) |
void | setReloadTime (float time) |
void | setWeapon (Weapon *weapon) |
WeaponMode (BaseObject *creator) | |
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode) |
XML loading and saving. | |
virtual | ~WeaponMode () |
Protected Member Functions | |
virtual void | fire ()=0 |
Protected Attributes | |
bool | bAutoReload_ |
bool | bParallelReload_ |
float | damage_ |
unsigned int | initialMagazines_ |
unsigned int | initialMunition_ |
unsigned int | munitionPerShot_ |
Vector3 | muzzleOffset_ |
float | reloadTime_ |
Private Member Functions | |
void | reloaded () |
void | updateMunition () |
Private Attributes | |
bool | bReloading_ |
unsigned int | mode_ |
Munition * | munition_ |
std::string | munitionname_ |
SubclassIdentifier< Munition > | munitiontype_ |
Timer< WeaponMode > | reloadTimer_ |
Weapon * | weapon_ |
orxonox::WeaponMode::WeaponMode | ( | BaseObject * | creator | ) |
orxonox::WeaponMode::~WeaponMode | ( | ) | [virtual] |
virtual void orxonox::WeaponMode::fire | ( | ) | [protected, pure virtual] |
Implemented in orxonox::EnergyDrink, orxonox::FusionFire, orxonox::HsW01, orxonox::LaserFire, and orxonox::LightningGun.
Referenced by fire().
bool orxonox::WeaponMode::fire | ( | float * | reloadTime | ) |
bool orxonox::WeaponMode::getAutoReload | ( | ) | const [inline] |
Referenced by XMLPort().
float orxonox::WeaponMode::getDamage | ( | ) | const [inline] |
unsigned int orxonox::WeaponMode::getInitialMagazines | ( | ) | const [inline] |
Referenced by XMLPort().
unsigned int orxonox::WeaponMode::getInitialMunition | ( | ) | const [inline] |
Referenced by XMLPort().
unsigned int orxonox::WeaponMode::getMode | ( | void | ) | const [inline] |
Referenced by orxonox::Weapon::addWeaponmode(), and XMLPort().
Munition* orxonox::WeaponMode::getMunition | ( | ) | const [inline] |
const std::string& orxonox::WeaponMode::getMunitionName | ( | ) | const [inline] |
Referenced by XMLPort().
unsigned int orxonox::WeaponMode::getMunitionPerShot | ( | ) | const [inline] |
Referenced by XMLPort().
Identifier* orxonox::WeaponMode::getMunitionType | ( | ) | const [inline] |
Vector3 orxonox::WeaponMode::getMuzzleDirection | ( | ) | const |
const Vector3& orxonox::WeaponMode::getMuzzleOffset | ( | ) | const [inline] |
Referenced by orxonox::HsW01::muendungsfeuer(), orxonox::EnergyDrink::muendungsfeuer(), and XMLPort().
const Quaternion & orxonox::WeaponMode::getMuzzleOrientation | ( | ) | const |
References orxonox::WorldEntity::getWorldOrientation(), and weapon_.
Referenced by orxonox::LightningGun::fire(), orxonox::LaserFire::fire(), orxonox::FusionFire::fire(), orxonox::HsW01::shot(), and orxonox::EnergyDrink::shot().
Vector3 orxonox::WeaponMode::getMuzzlePosition | ( | ) | const |
bool orxonox::WeaponMode::getParallelReload | ( | ) | const [inline] |
Referenced by XMLPort().
float orxonox::WeaponMode::getReloadTime | ( | ) | const [inline] |
Referenced by XMLPort().
Weapon* orxonox::WeaponMode::getWeapon | ( | ) | const [inline] |
bool orxonox::WeaponMode::reload | ( | ) |
void orxonox::WeaponMode::reloaded | ( | ) | [private] |
void orxonox::WeaponMode::setAutoReload | ( | bool | autoreload | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setDamage | ( | float | damage | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setInitialMagazines | ( | unsigned int | amount | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setInitialMunition | ( | unsigned int | amount | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setMode | ( | unsigned int | mode | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setMunitionName | ( | const std::string & | munitionname | ) |
void orxonox::WeaponMode::setMunitionPerShot | ( | unsigned int | amount | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setMunitionType | ( | Identifier * | identifier | ) |
References orxonox::Identifier::getName(), munitionname_, munitiontype_, and updateMunition().
void orxonox::WeaponMode::setMuzzleOffset | ( | const Vector3 & | offset | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setParallelReload | ( | bool | parallelreload | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setReloadTime | ( | float | time | ) | [inline] |
Referenced by XMLPort().
void orxonox::WeaponMode::setWeapon | ( | Weapon * | weapon | ) | [inline] |
Referenced by orxonox::Weapon::addWeaponmode().
void orxonox::WeaponMode::updateMunition | ( | ) | [private] |
References orxonox::Munition::addMagazines(), orxonox::Munition::addMunition(), orxonox::Munition::getMaxMunitionPerMagazine(), orxonox::WeaponSystem::getMunition(), orxonox::Munition::getNumMunitionInCurrentMagazine(), orxonox::Weapon::getWeaponPack(), orxonox::WeaponPack::getWeaponSystem(), initialMagazines_, initialMunition_, munition_, munitiontype_, orxonox::Munition::needReload(), orxonox::Munition::reload(), orxonox::Munition::takeMunition(), and weapon_.
Referenced by setMunitionName(), and setMunitionType().
void orxonox::WeaponMode::XMLPort | ( | Element & | xmlelement, | |
XMLPort::Mode | mode | |||
) | [virtual] |
XML loading and saving.
xmlelement | The XML-element | |
loading | Loading (true) or saving (false) |
Reimplemented from orxonox::BaseObject.
Reimplemented in orxonox::EnergyDrink, and orxonox::HsW01.
References getAutoReload(), getDamage(), getInitialMagazines(), getInitialMunition(), getMode(), getMunitionName(), getMunitionPerShot(), getMuzzleOffset(), getParallelReload(), getReloadTime(), setAutoReload(), setDamage(), setInitialMagazines(), setInitialMunition(), setMode(), setMunitionName(), setMunitionPerShot(), setMuzzleOffset(), setParallelReload(), setReloadTime(), SUPER, and XMLPortParam.
bool orxonox::WeaponMode::bAutoReload_ [protected] |
Referenced by fire(), and WeaponMode().
bool orxonox::WeaponMode::bParallelReload_ [protected] |
Referenced by fire(), orxonox::FusionFire::FusionFire(), reload(), and WeaponMode().
bool orxonox::WeaponMode::bReloading_ [private] |
Referenced by fire(), reload(), reloaded(), and WeaponMode().
float orxonox::WeaponMode::damage_ [protected] |
unsigned int orxonox::WeaponMode::initialMagazines_ [protected] |
Referenced by updateMunition(), and WeaponMode().
unsigned int orxonox::WeaponMode::initialMunition_ [protected] |
Referenced by updateMunition(), and WeaponMode().
unsigned int orxonox::WeaponMode::mode_ [private] |
Referenced by WeaponMode().
Munition* orxonox::WeaponMode::munition_ [private] |
Referenced by fire(), reload(), updateMunition(), and WeaponMode().
Referenced by setMunitionName(), and setMunitionType().
unsigned int orxonox::WeaponMode::munitionPerShot_ [protected] |
Referenced by WeaponMode().
Referenced by setMunitionName(), setMunitionType(), and updateMunition().
Vector3 orxonox::WeaponMode::muzzleOffset_ [protected] |
Referenced by getMuzzlePosition(), and WeaponMode().
float orxonox::WeaponMode::reloadTime_ [protected] |
Timer<WeaponMode> orxonox::WeaponMode::reloadTimer_ [private] |
Referenced by fire(), reload(), and WeaponMode().
Weapon* orxonox::WeaponMode::weapon_ [private] |
Referenced by getMuzzleDirection(), getMuzzleOrientation(), getMuzzlePosition(), updateMunition(), and WeaponMode().