#include <src/orxonox/objects/weaponsystem/WeaponSystem.h>
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_ |
orxonox::WeaponSystem::WeaponSystem | ( | BaseObject * | creator | ) |
References pawn_, and RegisterObject.
orxonox::WeaponSystem::~WeaponSystem | ( | ) | [virtual] |
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 | ) |
void orxonox::WeaponSystem::addWeaponSlot | ( | WeaponSlot * | wSlot | ) |
References orxonox::WeaponSlot::setWeaponSystem(), and weaponSlots_.
Referenced by orxonox::Pawn::addWeaponSlot().
bool orxonox::WeaponSystem::canAddWeaponPack | ( | WeaponPack * | wPack | ) |
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 | ) |
static unsigned int orxonox::WeaponSystem::getFiremodeMask | ( | unsigned int | firemode | ) | [inline, static] |
Munition * orxonox::WeaponSystem::getMunition | ( | SubclassIdentifier< Munition > * | identifier | ) |
Pawn* orxonox::WeaponSystem::getPawn | ( | ) | const [inline] |
Referenced by addWeaponPack().
WeaponPack * orxonox::WeaponSystem::getWeaponPack | ( | unsigned int | index | ) | const |
WeaponSet * orxonox::WeaponSystem::getWeaponSet | ( | unsigned int | index | ) | const |
WeaponSlot * orxonox::WeaponSystem::getWeaponSlot | ( | unsigned int | index | ) | const |
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 | ) |
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().
const unsigned int orxonox::WeaponSystem::FIRE_MODE_UNASSIGNED = static_cast<unsigned int>(-1) [static] |
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] |
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().