Orxonox: orxonox::Munition Class Reference

# orxonox::Munition Class Reference

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

Inheritance diagram for orxonox::Munition:

List of all members.

## Public Member Functions

bool | addMagazines (unsigned int amount)
bool | addMunition (unsigned int amount)
bool | canAddMagazines (unsigned int amount) const
bool | canAddMunition (unsigned int amount) const
bool | canReload () const
bool | canRemoveMagazines (unsigned int amount) const
bool | canTakeMunition (unsigned int amount, WeaponMode *user) const
bool | dropMagazine (WeaponMode *user)
unsigned int | getMaxMagazines () const
unsigned int | getMaxMunition () const
unsigned int | getMaxMunitionPerMagazine () const
unsigned int | getNumMagazines () const
unsigned int | getNumMunition (WeaponMode *user) const
unsigned int | getNumMunitionInCurrentMagazine (WeaponMode *user) const
float | getReloadTime () const
| Munition (BaseObject *creator)
bool | needReload (WeaponMode *user) const
bool | reload (WeaponMode *user, bool bUseReloadTime=true)
bool | removeMagazines (unsigned int amount)
bool | takeMunition (unsigned int amount, WeaponMode *user)
virtual | ~Munition ()

## Protected Attributes

bool | bAllowMultiMunitionRemovementUnderflow_
bool | bAllowMunitionRefilling_
bool | bStackMunition_
bool | bUseSeparateMagazines_
std::map< WeaponMode *, Magazine * > | currentMagazines_
unsigned int | magazines_
unsigned int | maxMagazines_
unsigned int | maxMunitionPerMagazine_
float | reloadTime_

## Private Member Functions

Magazine * | getMagazine (WeaponMode *user) const

## Classes

struct | Magazine

## Constructor & Destructor Documentation

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

References bAllowMultiMunitionRemovementUnderflow_, bAllowMunitionRefilling_, bStackMunition_, bUseSeparateMagazines_, magazines_, maxMagazines_, maxMunitionPerMagazine_, RegisterObject, and reloadTime_.

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

References currentMagazines_.

## Member Function Documentation

bool orxonox::Munition::addMagazines | ( | unsigned int | amount | ) |

References bStackMunition_, canAddMagazines(), currentMagazines_, getMagazine(), magazines_, maxMagazines_, maxMunitionPerMagazine_, and orxonox::Munition::Magazine::munition_.

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

bool orxonox::Munition::addMunition | ( | unsigned int | amount | ) |

References bStackMunition_, canAddMunition(), currentMagazines_, getMagazine(), magazines_, maxMagazines_, maxMunitionPerMagazine_, and orxonox::Munition::Magazine::munition_.

Referenced by orxonox::ReplenishingMunition::replenish(), and orxonox::WeaponMode::updateMunition().

bool orxonox::Munition::canAddMagazines | ( | unsigned int | amount | ) | const

References bStackMunition_, currentMagazines_, getMaxMunition(), getNumMunition(), magazines_, and maxMagazines_.

Referenced by addMagazines().

bool orxonox::Munition::canAddMunition | ( | unsigned int | amount | ) | const

References bAllowMunitionRefilling_, bStackMunition_, currentMagazines_, getMaxMunition(), and getNumMunition().

Referenced by addMunition().

bool orxonox::Munition::canReload | ( |  | ) | const

References bStackMunition_, and magazines_.

bool orxonox::Munition::canRemoveMagazines | ( | unsigned int | amount | ) | const

References bStackMunition_, getMagazine(), magazines_, and orxonox::Munition::Magazine::munition_.

Referenced by removeMagazines().

bool orxonox::Munition::canTakeMunition | ( | unsigned int | amount,
|  | WeaponMode * | user |
| ) |  |  | const

References bAllowMultiMunitionRemovementUnderflow_, orxonox::Munition::Magazine::bLoaded_, bStackMunition_, getMagazine(), magazines_, maxMunitionPerMagazine_, and orxonox::Munition::Magazine::munition_.

Referenced by takeMunition().

bool orxonox::Munition::dropMagazine | ( | WeaponMode * | user | ) |

References bUseSeparateMagazines_, and currentMagazines_.

Munition::Magazine * orxonox::Munition::getMagazine | ( | WeaponMode * | user | ) | const`[private]`

References bUseSeparateMagazines_, and currentMagazines_.

Referenced by addMagazines(), addMunition(), canRemoveMagazines(), canTakeMunition(), getNumMagazines(), getNumMunition(), getNumMunitionInCurrentMagazine(), needReload(), reload(), removeMagazines(), and takeMunition().

unsigned int orxonox::Munition::getMaxMagazines | ( |  | ) | const`[inline]`

unsigned int orxonox::Munition::getMaxMunition | ( |  | ) | const

References bStackMunition_, maxMagazines_, and maxMunitionPerMagazine_.

Referenced by canAddMagazines(), and canAddMunition().

unsigned int orxonox::Munition::getMaxMunitionPerMagazine | ( |  | ) | const`[inline]`

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

unsigned int orxonox::Munition::getNumMagazines | ( |  | ) | const

References bStackMunition_, getMagazine(), magazines_, and orxonox::Munition::Magazine::munition_.

unsigned int orxonox::Munition::getNumMunition | ( | WeaponMode * | user | ) | const

References bStackMunition_, getMagazine(), magazines_, maxMunitionPerMagazine_, and orxonox::Munition::Magazine::munition_.

Referenced by canAddMagazines(), and canAddMunition().

unsigned int orxonox::Munition::getNumMunitionInCurrentMagazine | ( | WeaponMode * | user | ) | const

References getMagazine(), and orxonox::Munition::Magazine::munition_.

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

float orxonox::Munition::getReloadTime | ( |  | ) | const`[inline]`

Referenced by orxonox::WeaponMode::fire(), and orxonox::WeaponMode::reload().

bool orxonox::Munition::needReload | ( | WeaponMode * | user | ) | const

References orxonox::Munition::Magazine::bLoaded_, bStackMunition_, getMagazine(), and orxonox::Munition::Magazine::munition_.

Referenced by orxonox::WeaponMode::fire(), and orxonox::WeaponMode::updateMunition().

bool orxonox::Munition::reload | ( | WeaponMode * | user,
|  | bool | bUseReloadTime = `true` |
| ) |  |  |

References orxonox::Munition::Magazine::bLoaded_, bUseSeparateMagazines_, currentMagazines_, getMagazine(), and magazines_.

Referenced by orxonox::WeaponMode::fire(), orxonox::WeaponMode::reload(), takeMunition(), and orxonox::WeaponMode::updateMunition().

bool orxonox::Munition::removeMagazines | ( | unsigned int | amount | ) |

References bStackMunition_, canRemoveMagazines(), getMagazine(), magazines_, and orxonox::Munition::Magazine::munition_.

bool orxonox::Munition::takeMunition | ( | unsigned int | amount,
|  | WeaponMode * | user |
| ) |  |  |

References bAllowMultiMunitionRemovementUnderflow_, orxonox::Munition::Magazine::bLoaded_, bStackMunition_, canTakeMunition(), getMagazine(), orxonox::Munition::Magazine::munition_, and reload().

Referenced by orxonox::WeaponMode::fire(), and orxonox::WeaponMode::updateMunition().

## Member Data Documentation

bool orxonox::Munition::bAllowMultiMunitionRemovementUnderflow_`[protected]`

Referenced by canTakeMunition(), orxonox::FusionMunition::FusionMunition(), orxonox::LaserMunition::LaserMunition(), Munition(), and takeMunition().

bool orxonox::Munition::bAllowMunitionRefilling_`[protected]`

Referenced by canAddMunition(), orxonox::FusionMunition::FusionMunition(), orxonox::LaserMunition::LaserMunition(), Munition(), and orxonox::ReplenishingMunition::replenish().

bool orxonox::Munition::bStackMunition_`[protected]`

Referenced by addMagazines(), addMunition(), canAddMagazines(), canAddMunition(), canReload(), canRemoveMagazines(), canTakeMunition(), orxonox::FusionMunition::FusionMunition(), getMaxMunition(), getNumMagazines(), getNumMunition(), orxonox::LaserMunition::LaserMunition(), orxonox::Munition::Magazine::Magazine(), Munition(), needReload(), removeMagazines(), and takeMunition().

bool orxonox::Munition::bUseSeparateMagazines_`[protected]`

Referenced by dropMagazine(), orxonox::FusionMunition::FusionMunition(), getMagazine(), orxonox::LaserMunition::LaserMunition(), Munition(), and reload().

std::map<WeaponMode*, Magazine*> orxonox::Munition::currentMagazines_`[protected]`

Referenced by addMagazines(), addMunition(), canAddMagazines(), canAddMunition(), dropMagazine(), getMagazine(), reload(), and ~Munition().

unsigned int orxonox::Munition::magazines_`[protected]`

Referenced by addMagazines(), addMunition(), canAddMagazines(), canReload(), canRemoveMagazines(), canTakeMunition(), orxonox::FusionMunition::FusionMunition(), getNumMagazines(), getNumMunition(), orxonox::LaserMunition::LaserMunition(), Munition(), reload(), and removeMagazines().

unsigned int orxonox::Munition::maxMagazines_`[protected]`

Referenced by addMagazines(), addMunition(), canAddMagazines(), orxonox::FusionMunition::FusionMunition(), getMaxMunition(), orxonox::LaserMunition::LaserMunition(), and Munition().

unsigned int orxonox::Munition::maxMunitionPerMagazine_`[protected]`

Referenced by addMagazines(), addMunition(), canTakeMunition(), orxonox::FusionMunition::FusionMunition(), getMaxMunition(), getNumMunition(), orxonox::LaserMunition::LaserMunition(), orxonox::Munition::Magazine::loaded(), and Munition().

float orxonox::Munition::reloadTime_`[protected]`

Referenced by orxonox::FusionMunition::FusionMunition(), orxonox::Munition::Magazine::Magazine(), and Munition().

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

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