Orxonox: orxonox::Weapon Class Reference

# orxonox::Weapon Class Reference

`#include <src/orxonox/objects/weaponsystem/Weapon.h>`

Inheritance diagram for orxonox::Weapon:

List of all members.

## Public Member Functions

void | addWeaponmode (WeaponMode *weaponmode)
void | fire (unsigned int mode)
WeaponMode * | getWeaponmode (unsigned int index) const
WeaponPack * | getWeaponPack () const
WeaponSlot * | getWeaponSlot () const
void | reload ()
void | setWeaponPack (WeaponPack *weaponPack)
void | setWeaponSlot (WeaponSlot *wSlot)
| Weapon (BaseObject *creator)
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
virtual | ~Weapon ()

## Private Member Functions

void | notifyWeaponModes ()
void | reloaded ()

## Private Attributes

bool | bReloading_
unsigned int | reloadingWeaponmode_
Timer< Weapon > | reloadTimer_
std::multimap< unsigned int, WeaponMode * > | weaponmodes_
WeaponPack * | weaponPack_
WeaponSlot * | weaponSlot_

## Constructor & Destructor Documentation

orxonox::Weapon::Weapon | ( | BaseObject * | creator | ) |

References bReloading_, orxonox::createExecutor(), RegisterObject, reloaded(), reloadingWeaponmode_, reloadTimer_, orxonox::WeaponSystem::WEAPON_MODE_UNASSIGNED, weaponPack_, and weaponSlot_.

orxonox::Weapon::~Weapon | ( |  | ) | `[virtual]`

References orxonox::BaseObject::isInitialized(), orxonox::WeaponPack::removeWeapon(), weaponmodes_, and weaponPack_.

## Member Function Documentation

void orxonox::Weapon::addWeaponmode | ( | WeaponMode * | weaponmode | ) |

References orxonox::WeaponMode::getMode(), orxonox::WeaponMode::setWeapon(), and weaponmodes_.

Referenced by XMLPort().

void orxonox::Weapon::fire | ( | unsigned int | mode | ) |

References bReloading_, reloadingWeaponmode_, reloadTimer_, and weaponmodes_.

WeaponMode * orxonox::Weapon::getWeaponmode | ( | unsigned int | index | ) | const

References weaponmodes_.

Referenced by XMLPort().

WeaponPack* orxonox::Weapon::getWeaponPack | ( |  | ) | const`[inline]`

Referenced by orxonox::WeaponSystem::removeWeaponSlot(), and orxonox::WeaponMode::updateMunition().

WeaponSlot* orxonox::Weapon::getWeaponSlot | ( |  | ) | const`[inline]`

Referenced by orxonox::WeaponSystem::removeWeaponPack().

void orxonox::Weapon::notifyWeaponModes | ( |  | ) | `[private]`

References weaponmodes_.

void orxonox::Weapon::reload | ( |  | ) |

References weaponmodes_.

void orxonox::Weapon::reloaded | ( |  | ) | `[private]`

References bReloading_, reloadingWeaponmode_, and orxonox::WeaponSystem::WEAPON_MODE_UNASSIGNED.

Referenced by Weapon().

void orxonox::Weapon::setWeaponPack | ( | WeaponPack * | weaponPack | ) | `[inline]`

Referenced by orxonox::WeaponPack::addWeapon(), and orxonox::WeaponPack::removeWeapon().

void orxonox::Weapon::setWeaponSlot | ( | WeaponSlot * | wSlot | ) | `[inline]`

Referenced by orxonox::WeaponSlot::attachWeapon(), and orxonox::WeaponSlot::removeWeapon().

void orxonox::Weapon::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

XML loading and saving.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::WorldEntity.

References addWeaponmode(), getWeaponmode(), SUPER, and XMLPortObject.

## Member Data Documentation

bool orxonox::Weapon::bReloading_`[private]`

Referenced by fire(), reloaded(), and Weapon().

unsigned int orxonox::Weapon::reloadingWeaponmode_`[private]`

Referenced by fire(), reloaded(), and Weapon().

Timer<Weapon> orxonox::Weapon::reloadTimer_`[private]`

Referenced by fire(), and Weapon().

std::multimap<unsigned int, WeaponMode*> orxonox::Weapon::weaponmodes_`[private]`

Referenced by addWeaponmode(), fire(), getWeaponmode(), notifyWeaponModes(), reload(), and ~Weapon().

WeaponPack* orxonox::Weapon::weaponPack_`[private]`

Referenced by Weapon(), and ~Weapon().

WeaponSlot* orxonox::Weapon::weaponSlot_`[private]`

Referenced by Weapon().

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

- src/orxonox/objects/weaponsystem/Weapon.h
- src/orxonox/objects/weaponsystem/Weapon.cc