Orxonox: orxonox::WeaponPack Class Reference

# orxonox::WeaponPack Class Reference

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

Inheritance diagram for orxonox::WeaponPack:

List of all members.

## Public Member Functions

void | addDefaultWeaponmodeLink (DefaultWeaponmodeLink *link)
void | addWeapon (Weapon *weapon)
void | fire (unsigned int weaponmode)
DefaultWeaponmodeLink * | getDefaultWeaponmodeLink (unsigned int index) const
unsigned int | getDesiredWeaponmode (unsigned int firemode) const
size_t | getNumWeapons () const
Weapon * | getWeapon (unsigned int index) const
WeaponSystem * | getWeaponSystem () const
void | reload ()
void | removeWeapon (Weapon *weapon)
void | setWeaponSystem (WeaponSystem *weaponSystem)
| WeaponPack (BaseObject *creator)
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
virtual | ~WeaponPack ()

## Private Member Functions

void | notifyWeapons ()

## Private Attributes

std::set< DefaultWeaponmodeLink * > | links_
std::set< Weapon * > | weapons_
WeaponSystem * | weaponSystem_

## Constructor & Destructor Documentation

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

References RegisterObject, and weaponSystem_.

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

References orxonox::BaseObject::isInitialized(), links_, orxonox::WeaponSystem::removeWeaponPack(), weapons_, and weaponSystem_.

## Member Function Documentation

void orxonox::WeaponPack::addDefaultWeaponmodeLink | ( | DefaultWeaponmodeLink * | link | ) |

References links_.

Referenced by XMLPort().

void orxonox::WeaponPack::addWeapon | ( | Weapon * | weapon | ) |

References orxonox::Weapon::setWeaponPack(), and weapons_.

Referenced by XMLPort().

void orxonox::WeaponPack::fire | ( | unsigned int | weaponmode | ) |

References weapons_.

DefaultWeaponmodeLink * orxonox::WeaponPack::getDefaultWeaponmodeLink | ( | unsigned int | index | ) | const

References links_.

Referenced by XMLPort().

unsigned int orxonox::WeaponPack::getDesiredWeaponmode | ( | unsigned int | firemode | ) | const

References links_, and orxonox::WeaponSystem::WEAPON_MODE_UNASSIGNED.

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

size_t orxonox::WeaponPack::getNumWeapons | ( |  | ) | const`[inline]`

Referenced by orxonox::WeaponSystem::addWeaponPack(), and orxonox::WeaponSystem::canAddWeaponPack().

Weapon * orxonox::WeaponPack::getWeapon | ( | unsigned int | index | ) | const

References weapons_.

Referenced by orxonox::WeaponSystem::addWeaponPack(), orxonox::WeaponSystem::removeWeaponPack(), and XMLPort().

WeaponSystem* orxonox::WeaponPack::getWeaponSystem | ( |  | ) | const`[inline]`

Referenced by orxonox::WeaponMode::updateMunition().

void orxonox::WeaponPack::notifyWeapons | ( |  | ) | `[private]`

References weapons_.

void orxonox::WeaponPack::reload | ( |  | ) |

References weapons_.

void orxonox::WeaponPack::removeWeapon | ( | Weapon * | weapon | ) |

References orxonox::Weapon::setWeaponPack(), and weapons_.

Referenced by orxonox::Weapon::~Weapon().

void orxonox::WeaponPack::setWeaponSystem | ( | WeaponSystem * | weaponSystem | ) | `[inline]`

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

void orxonox::WeaponPack::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::BaseObject.

References addDefaultWeaponmodeLink(), addWeapon(), getDefaultWeaponmodeLink(), getWeapon(), SUPER, XMLPortObject, and XMLPortObjectExtended.

## Member Data Documentation

std::set<DefaultWeaponmodeLink *> orxonox::WeaponPack::links_`[private]`

Referenced by addDefaultWeaponmodeLink(), getDefaultWeaponmodeLink(), getDesiredWeaponmode(), and ~WeaponPack().

std::set<Weapon *> orxonox::WeaponPack::weapons_`[private]`

Referenced by addWeapon(), fire(), getWeapon(), notifyWeapons(), reload(), removeWeapon(), and ~WeaponPack().

WeaponSystem* orxonox::WeaponPack::weaponSystem_`[private]`

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

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

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