Orxonox: orxonox::WeaponSystem Class Reference

# orxonox::WeaponSystem Class Reference

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

Inheritance diagram for orxonox::WeaponSystem:

List of all members.

## Public Member Functions

bool | addWeaponPack (WeaponPack *wPack)
bool | addWeaponSet (WeaponSet *wSet, unsigned int firemode)
bool | addWeaponSet (WeaponSet *wSet)
void | addWeaponSlot (WeaponSlot *wSlot)
bool | canAddWeaponPack (WeaponPack *wPack)
void | changeWeaponmode (WeaponPack *wPack, WeaponSet *wSet, unsigned int weaponmode)
void | fire (unsigned int firemode)
Munition * | getMunition (SubclassIdentifier< Munition > *identifier)
Pawn * | getPawn () const
WeaponPack * | getWeaponPack (unsigned int index) const
WeaponSet * | getWeaponSet (unsigned int index) const
WeaponSlot * | getWeaponSlot (unsigned int index) const
int | getWeaponSlotSize () const
void | reload ()
void | removeWeaponPack (WeaponPack *wPack)
void | removeWeaponSet (WeaponSet *wSet)
void | removeWeaponSlot (WeaponSlot *wSlot)
void | setPawn (Pawn *pawn)
bool | swapWeaponSlots (WeaponSlot *wSlot1, WeaponSlot *wSlot2)
| WeaponSystem (BaseObject *creator)
virtual | ~WeaponSystem ()

## Static Public Member Functions

static unsigned int | getFiremodeMask (unsigned int firemode)

## Static Public Attributes

static const unsigned int | FIRE_MODE_UNASSIGNED = static_cast<unsigned int>(-1)
static const unsigned int | MAX_FIRE_MODES = 8
static const unsigned int | MAX_WEAPON_MODES = 8
static const unsigned int | WEAPON_MODE_UNASSIGNED = static_cast<unsigned int>(-1)

## Private Attributes

std::map< Identifier *, Munition * > | munitions_
Pawn * | pawn_
std::set< WeaponPack * > | weaponPacks_
std::map< unsigned int, WeaponSet * > | weaponSets_
std::vector< WeaponSlot * > | weaponSlots_

## Constructor & Destructor Documentation

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

References pawn_, and RegisterObject.

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

References orxonox::BaseObject::isInitialized(), munitions_, pawn_, orxonox::Pawn::setWeaponSystem(), weaponPacks_, weaponSets_, and weaponSlots_.

## Member Function Documentation

bool orxonox::WeaponSystem::addWeaponPack | ( | WeaponPack * | wPack | ) |

References orxonox::WorldEntity::attach(), canAddWeaponPack(), orxonox::WeaponPack::getDesiredWeaponmode(), orxonox::WeaponPack::getNumWeapons(), getPawn(), orxonox::WeaponPack::getWeapon(), orxonox::WeaponPack::setWeaponSystem(), WEAPON_MODE_UNASSIGNED, weaponPacks_, weaponSets_, and weaponSlots_.

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

bool orxonox::WeaponSystem::addWeaponSet | ( | WeaponSet * | wSet,
|  | unsigned int | firemode |
| ) |  |  |

References MAX_FIRE_MODES, orxonox::WeaponSet::setWeaponSystem(), and weaponSets_.

bool orxonox::WeaponSystem::addWeaponSet | ( | WeaponSet * | wSet | ) |

References orxonox::WeaponSet::getDesiredFiremode().

Referenced by orxonox::Pawn::addWeaponSet().

void orxonox::WeaponSystem::addWeaponSlot | ( | WeaponSlot * | wSlot | ) |

References orxonox::WeaponSlot::setWeaponSystem(), and weaponSlots_.

Referenced by orxonox::Pawn::addWeaponSlot().

bool orxonox::WeaponSystem::canAddWeaponPack | ( | WeaponPack * | wPack | ) |

References orxonox::WeaponPack::getNumWeapons(), and weaponSlots_.

Referenced by addWeaponPack().

void orxonox::WeaponSystem::changeWeaponmode | ( | WeaponPack * | wPack,
|  | WeaponSet * | wSet,
|  | unsigned int | weaponmode |
| ) |  |  |

References orxonox::WeaponSet::setWeaponmodeLink(), weaponPacks_, and weaponSets_.

void orxonox::WeaponSystem::fire | ( | unsigned int | firemode | ) |

References weaponSets_.

Referenced by orxonox::Pawn::doFire().

static unsigned int orxonox::WeaponSystem::getFiremodeMask | ( | unsigned int | firemode | ) | `[inline, static]`

Munition * orxonox::WeaponSystem::getMunition | ( | SubclassIdentifier< Munition > * | identifier | ) |

References Class, orxonox::SubclassIdentifier< T >::fabricate(), orxonox::SubclassIdentifier< T >::getIdentifier(), orxonox::Identifier::isA(), and munitions_.

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

Pawn* orxonox::WeaponSystem::getPawn | ( |  | ) | const`[inline]`

Referenced by addWeaponPack().

WeaponPack * orxonox::WeaponSystem::getWeaponPack | ( | unsigned int | index | ) | const

References weaponPacks_.

Referenced by orxonox::Pawn::getWeaponPack().

WeaponSet * orxonox::WeaponSystem::getWeaponSet | ( | unsigned int | index | ) | const

References weaponSets_.

Referenced by orxonox::Pawn::getWeaponSet().

WeaponSlot * orxonox::WeaponSystem::getWeaponSlot | ( | unsigned int | index | ) | const

References weaponSlots_.

Referenced by orxonox::Pawn::getWeaponSlot().

int orxonox::WeaponSystem::getWeaponSlotSize | ( |  | ) | const`[inline]`

void orxonox::WeaponSystem::reload | ( |  | ) |

References weaponSets_.

void orxonox::WeaponSystem::removeWeaponPack | ( | WeaponPack * | wPack | ) |

References orxonox::WeaponPack::getWeapon(), orxonox::Weapon::getWeaponSlot(), orxonox::WeaponSlot::removeWeapon(), weaponPacks_, and weaponSets_.

Referenced by removeWeaponSlot(), and orxonox::WeaponPack::~WeaponPack().

void orxonox::WeaponSystem::removeWeaponSet | ( | WeaponSet * | wSet | ) |

References weaponSets_.

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

void orxonox::WeaponSystem::removeWeaponSlot | ( | WeaponSlot * | wSlot | ) |

References orxonox::WeaponSlot::getWeapon(), orxonox::Weapon::getWeaponPack(), removeWeaponPack(), and weaponSlots_.

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

void orxonox::WeaponSystem::setPawn | ( | Pawn * | pawn | ) | `[inline]`

Referenced by orxonox::Pawn::Pawn().

bool orxonox::WeaponSystem::swapWeaponSlots | ( | WeaponSlot * | wSlot1,
|  | WeaponSlot * | wSlot2 |
| ) |  |  |

References orxonox::WeaponSlot::attachWeapon(), and orxonox::WeaponSlot::getWeapon().

## Member Data Documentation

const unsigned int orxonox::WeaponSystem::FIRE_MODE_UNASSIGNED = static_cast<unsigned int>(-1)`[static]`

Referenced by orxonox::DefaultWeaponmodeLink::DefaultWeaponmodeLink(), and orxonox::WeaponSet::WeaponSet().

const unsigned int orxonox::WeaponSystem::MAX_FIRE_MODES = 8`[static]`

Referenced by addWeaponSet().

const unsigned int orxonox::WeaponSystem::MAX_WEAPON_MODES = 8`[static]`

std::map<Identifier *, Munition *> orxonox::WeaponSystem::munitions_`[private]`

Referenced by getMunition(), and ~WeaponSystem().

Pawn* orxonox::WeaponSystem::pawn_`[private]`

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

const unsigned int orxonox::WeaponSystem::WEAPON_MODE_UNASSIGNED = static_cast<unsigned int>(-1)`[static]`

Referenced by addWeaponPack(), orxonox::DefaultWeaponmodeLink::DefaultWeaponmodeLink(), orxonox::WeaponSet::fire(), orxonox::WeaponPack::getDesiredWeaponmode(), orxonox::WeaponSet::getWeaponmodeLink(), orxonox::Weapon::reloaded(), orxonox::Weapon::Weapon(), and orxonox::WeaponMode::WeaponMode().

std::set<WeaponPack *> orxonox::WeaponSystem::weaponPacks_`[private]`

Referenced by addWeaponPack(), changeWeaponmode(), getWeaponPack(), removeWeaponPack(), and ~WeaponSystem().

std::map<unsigned int, WeaponSet *> orxonox::WeaponSystem::weaponSets_`[private]`

Referenced by addWeaponPack(), addWeaponSet(), changeWeaponmode(), fire(), getWeaponSet(), reload(), removeWeaponPack(), removeWeaponSet(), and ~WeaponSystem().

std::vector<WeaponSlot *> orxonox::WeaponSystem::weaponSlots_`[private]`

Referenced by addWeaponPack(), addWeaponSlot(), canAddWeaponPack(), getWeaponSlot(), removeWeaponSlot(), and ~WeaponSystem().

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

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