Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/vs-enhencements/src/world_entities/weapons/weapon_manager.cc @ 10678

Last change on this file since 10678 was 10678, checked in by nicolasc, 17 years ago

xfer

File size: 17.4 KB
RevLine 
[4826]1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11### File Specific
12   main-programmer: Patrick Boenzli
[4832]13   co-programmer: Benjamin Grauer
[4951]14
15   2005-07-24: Benjamin Grauer: restructurate, so it can handle the new Weapons.
[10437]16   2007-01-28: Patrick Boenzli: loadable slots
[4826]17*/
18
[9869]19#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
[4826]20
21#include "weapon_manager.h"
22#include "weapon.h"
[10437]23#include "weapon_slot.h"
[4834]24#include "crosshair.h"
[4828]25
[6561]26#include "playable.h"
27
[9869]28#include "util/loading/load_param_xml.h"
[7193]29#include "util/loading/factory.h"
[6055]30
[4837]31#include "t_animation.h"
[4826]32
33
[9869]34ObjectListDefinition(WeaponManager);
[4826]35/**
[6054]36 * @brief this initializes the weaponManager for a given nnumber of weapon slots
[10672]37 * @param number of weapon slots of the model/ship <= 10 (limitied)
[4826]38 */
[6142]39WeaponManager::WeaponManager(WorldEntity* parent)
[4826]40{
[4833]41  this->init();
[8844]42  this->setParentEntity(parent);
43
44  assert (parent != NULL);
[4826]45}
46
[4949]47WeaponManager::WeaponManager(const TiXmlElement* root)
48{
49  this->init();
50  this->loadParams(root);
51}
[4826]52
[4833]53/**
[6054]54 * @brief Destroys a WeaponManager
[4833]55 */
[4826]56WeaponManager::~WeaponManager()
57{
[4834]58  // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.)
[8147]59  // rennerc: crosshair seems not to delete itselve
[9869]60  //if (Crosshair::objectList().exists(this->crosshair))
61  //  delete this->crosshair;
[4826]62}
63
[4834]64/**
[6054]65 * @brief initializes the WeaponManager
[4834]66 */
[4833]67void WeaponManager::init()
68{
[9869]69  this->registerObject(this, WeaponManager::_objectList);
[4826]70
[8844]71  this->parentNode = NULL;
72  this->parentEntity = NULL;
[4951]73
[10676]74//   for (int i = 0; i < WM_MAX_CONFIGS; i++)
75//     for (int j = 0; j < WM_MAX_SLOTS; j++)
76//       this->configs[i][j] = NULL;
[4951]77
78  for (int i = 0; i < WM_MAX_SLOTS; i++)
[4833]79  {
[10676]80    this->slotConfigs[i] = new WeaponSlot();
81    this->slotConfigs[i]->setCapability(WTYPE_ALL);
82//     this->slotConfigs[i]->setCurrentWeapon(NULL);
83//     this->slotConfigs[i]->setNextWeapon(NULL);
[4992]84
85    // NAMING
86    char* tmpName;
[9406]87    if (!this->getName().empty())
[4992]88    {
[9406]89      tmpName = new char[this->getName().size() + 10];
90      sprintf(tmpName, "%s_slot%d", this->getCName(), i);
[4992]91    }
92    else
93    {
94      tmpName = new char[30];
95      sprintf(tmpName, "WeaponMan_slot%d", i);
96    }
[10676]97    this->slotConfigs[i]->setName(tmpName);
98    this->slotConfigs[i]->deactivateNode();
[5208]99    delete[] tmpName;
[4833]100  }
[4895]101
[10678]102//   for (int i = 0; i < WM_MAX_LOADED_WEAPONS; i++)
103//     this->availiableWeapons[i] = NULL;
[4895]104
105
[4951]106  this->currentConfigID = 0;
[10368]107  this->slotCount = WM_MAX_SLOTS;
[8315]108  //this->weaponChange;
[4895]109
[4951]110  // CROSSHAIR INITIALISATION
[4834]111  this->crosshair = new Crosshair();
[6807]112  //this->crosshair->setRelCoor(1000,0,0);
[4837]113  this->crossHairSizeAnim = new tAnimation<Crosshair>(this->crosshair, &Crosshair::setSize);
114  this->crossHairSizeAnim->setInfinity(ANIM_INF_REWIND);
115  this->crossHairSizeAnim->addKeyFrame(50, .1, ANIM_LINEAR);
116  this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
117  this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
[10368]118
119  this->hideCrosshair();
120
121  this->bFire = false;
[4834]122}
[4833]123
[10368]124void WeaponManager::showCrosshair()
125{
126  this->crosshair->setVisibility( true);
127}
128
129void WeaponManager::hideCrosshair()
130{
131  this->crosshair->setVisibility( false);
132}
133
134void WeaponManager::setRotationSpeed(float speed)
135{
136  this->crosshair->setRotationSpeed(speed);
137}
138
[4834]139/**
[7350]140 * @brief loads the settings of the WeaponManager
[4834]141 * @param root the XML-element to load from
142 */
143void WeaponManager::loadParams(const TiXmlElement* root)
144{
[6512]145  BaseObject::loadParams(root);
[4972]146
[10669]147  LoadParam(root, "slotCount", this, WeaponManager, setSlotCount)
[6736]148  .describe("how many slots(cannons) the WeaponManager can handle");
[4834]149
[10669]150
[5644]151  LOAD_PARAM_START_CYCLE(root, element);
[5654]152  {
153    // CHECK IF THIS WORKS....
154    LoadParamXML_CYCLE(element, "weapons", this, WeaponManager, loadWeapons)
[6736]155    .describe("loads Weapons");
[5654]156  }
[5644]157  LOAD_PARAM_END_CYCLE(element);
[10669]158
159
[4833]160}
161
[4826]162/**
[7350]163 * @brief loads a Weapon onto the WeaponManager
[4834]164 * @param root the XML-element to load the Weapons from
165 */
166void WeaponManager::loadWeapons(const TiXmlElement* root)
167{
[5644]168  LOAD_PARAM_START_CYCLE(root, element);
[4834]169
[8315]170  BaseObject* object = Factory::fabricate(element);
171  if (object != NULL)
172  {
173    Weapon* newWeapon = dynamic_cast<Weapon*>(object);
174    if (newWeapon == NULL)
175      delete object;
176  }
[5644]177  LOAD_PARAM_END_CYCLE(element);
[4834]178}
179
[4992]180/**
[7350]181 * @brief sets the Parent of the WeaponManager.
[4992]182 * @param parent the parent of the WeaponManager
183 *
184 * this is used, to identify to which ship/man/whatever this WeaponManager is connected.
185 * also all the Slots will be subconnected to this parent.
[5435]186 *
187 * The reason this function exists is that the WeaponManager is neither a WorldEntity nor
188 * a PNode.
[4992]189 */
[8844]190void WeaponManager::setParentEntity(WorldEntity* parent)
[4953]191{
[8844]192  this->parentEntity = parent;
193  if (this->parentNode == NULL)
194    this->setParentNode(parent);
195}
196
197
198void WeaponManager::setParentNode(PNode* parent)
199{
200  this->parentNode = parent;
201  assert(parent != NULL);
202
203  if (this->parentNode != NULL)
[4953]204  {
205    for (int i = 0; i < WM_MAX_SLOTS; i++)
[10676]206      this->parentNode->addChild(this->slotConfigs[i]);
[4953]207  }
[8844]208
[4953]209}
210
[8844]211
[4834]212/**
[7350]213 * @brief sets the number of Slots the WeaponManager has
[4926]214 * @param slotCount the number of slots
[4834]215 */
[4951]216void WeaponManager::setSlotCount(unsigned int slotCount)
[4834]217{
[4951]218  if (slotCount <= WM_MAX_SLOTS)
219    this->slotCount = slotCount;
220  else
221    this->slotCount = WM_MAX_SLOTS;
[4834]222}
223
[4972]224
225/**
[7350]226 * @brief sets the position of the Slot relative to the parent
[4972]227 * @param slot the slot to set-up
228 * @param position the position of the given slot
229 */
[6803]230void WeaponManager::setSlotPosition(int slot, const Vector& position, PNode* parent)
[4953]231{
232  if (slot < this->slotCount)
[6803]233  {
[10676]234    this->slotConfigs[slot]->setRelCoor(position);
[6803]235
236    if (parent != NULL)
[10676]237      this->slotConfigs[slot]->setParent(parent);
[6803]238  }
[4953]239}
240
[4972]241
242/**
[7350]243 * @brief sets the relative rotation of the slot to its parent
[4972]244 * @param slot the slot to set-up
245 * @param rotation the relative rotation of the given slot
246 */
[4969]247void WeaponManager::setSlotDirection(int slot, const Quaternion& rotation)
248{
249  if (slot < this->slotCount)
[10676]250    this->slotConfigs[slot]->setRelDir(rotation);
[4969]251}
252
253
[4834]254/**
[7350]255 * @brief adds a weapon to the selected weaponconfiguration into the selected slot
[4972]256 * @param weapon the weapon to add
257 * @param configID an identifier for the slot: number between 0..7 if not specified: slotID=next free slot
258 * @param slotID an identifier for the weapon configuration, number between 0..3
[4832]259 *
260 * if you add explicitly a weapon at config:n, slot:m, the weapon placed at this location will be
[4906]261 * replaced by the weapon specified. if you use the WM_FREE_SLOT, the manager will look for a free
[4832]262 * slot in this weaponconfiguration. if there is non, the weapon won't be added and there will be
263 * a error message.
[4826]264 */
[6561]265bool WeaponManager::addWeapon(Weapon* weapon, int configID, int slotID)
[4826]266{
[6753]267  if ( weapon == NULL )
[6737]268    return false;
[6679]269
[4951]270  if (unlikely(configID >= WM_MAX_CONFIGS || slotID >= (int)this->slotCount))
[4826]271  {
[6679]272    PRINTF(2)("Slot %d of config %d is not availiabe (max: %d) searching for suitable slot\n", slotID, configID, this->slotCount);
273    if (configID >= WM_MAX_CONFIGS)
274      configID = -1;
275    if (slotID >= (int)this->slotCount)
276      slotID = -1;
[4951]277  }
[10676]278//   if no ConfigID is supplied set to Current Config.
[6679]279  if (configID <= -1)
280    configID = this->currentConfigID;
281  //
282  if (configID > -1 && slotID == -1)
283  {
284    slotID = this->getNextFreeSlot(configID, weapon->getCapability());
285    if (slotID == -1)
286      configID = -1;
287  }
[4951]288
[10678]289  if (configID > 0 && slotID > 0 && this->slotConfigs[slotID]->getWeapon(configID) != NULL)
290  {
291    PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->getCName(), weapon->getClassCName(), weapon->getCName());
292    return false;
293  }
[4951]294
[10678]295  if (slotID <= -1) // WM_FREE_SLOT
296  {
297    slotID = this->getNextFreeSlot(configID, weapon->getCapability());
298    if( slotID < 0 || slotID >= this->slotCount)
299    {
300      PRINTF(1)("There is no free slot in this WeaponConfig to dock this weapon at! Aborting\n");
301      return false;
302    }
303  }
[4953]304
[10678]305  if (!(this->slotConfigs[slotID]->getCapability() & weapon->getCapability() & WTYPE_ALLKINDS) &&
306      this->slotConfigs[slotID]->getCapability() & weapon->getCapability() & WTYPE_ALLDIRS)
307  {
308    PRINTF(2)("Unable to add Weapon with wrong capatibility to Slot %d (W:%d M:%d)\n",
309              slotID, weapon->getCapability(), this->slotConfigs[slotID]->getCapability());
310    return false;
311  }
[5441]312
[4953]313  //! @todo check if the weapon is already assigned to another config in another slot
[10676]314//   if (this->configs[configID][slotID] != NULL)
315//     return false;
316  if( this->slotConfigs[slotID]->getWeapon(configID) != NULL )
[6714]317    return false;
[6676]318
[10676]319  this->slotConfigs[slotID]->setWeapon(weapon, configID);
[6669]320  weapon->setAmmoContainer(this->getAmmoContainer(weapon->getProjectileType()));
[10676]321//   if(configID == this->currentConfigID)
322//     this->slotConfigs[slotID]->setNextWeapon(weapon);
[8844]323  //if (this->parent != NULL)
[6142]324  {
[8844]325    this->parentNode->addChild(weapon);
[9869]326    if (this->parentEntity->isA(Playable::staticClassID()))
[8844]327      dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
[10437]328
[6920]329    weapon->setDefaultTarget(this->crosshair);
[6142]330  }
[9869]331  PRINTF(4)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassCName(), weapon->getCName(), configID, slotID);
[6561]332  return true;
[4826]333}
334
[4834]335/**
[6931]336 * @brief increases the Energy of the WeaponContainer of type (projectileType)
337 * @param projectileType the type of weapon to increase Energy from
338 * @param ammo the ammo to increase
339 */
[9869]340float WeaponManager::increaseAmmunition(const ClassID& projectileType, float ammo)
[6931]341{
342  return this->getAmmoContainer(projectileType)->increaseEnergy(ammo);
343}
344
[6972]345/**
[10368]346 * @brief does the same as the funtion increaseAmmunition, added four your convenience
[6972]347 * @param weapon, the Weapon to read the ammo-info about.
348 * @param ammo how much ammo to add.
349 */
[10368]350float WeaponManager::increaseAmmunition(const Weapon* weapon, float ammo)
[6972]351{
352  assert (weapon != NULL);
[9869]353  return this->increaseAmmunition(weapon->getClassID(), ammo);
[6931]354
[6972]355}
[6931]356
[6972]357
[6931]358/**
[4954]359 * sets the capabilities of a Slot
360 * @param slot the slot to set the capability
[10437]361 * @param slotCapability the capability @see WeaponSlotCapability
[4954]362 */
[10669]363void WeaponManager::setSlotCapability(int slot, unsigned long slotCapability)
[4954]364{
365  if (slot > slotCount)
366    return;
[10676]367  this->slotConfigs[slot]->setCapability(slotCapability);
[4954]368}
369
370
371/**
[4834]372 * removes a Weapon from the WeaponManager
[4954]373 *
374 * !! The weapon must be inactive before you can delete it,    !!
375 * !! because it will still be deactivated (if it is selected) !!
[4834]376 */
[4826]377void WeaponManager::removeWeapon(Weapon* weapon, int configID)
378{
[4954]379  if (weapon == NULL)
380    return;
381  if (configID < 0)
382  {
383    for (int j = 0; j < WM_MAX_SLOTS; j++)
384    {
385      for (int i = 0; i < WM_MAX_CONFIGS; i++)
386      {
[10676]387        if (this->slotConfigs[j]->getWeapon(i) == weapon)
388          this->slotConfigs[j]->setWeapon(NULL, i);
[4954]389      }
[10676]390//       if (this->slotConfigs[j]->getCurrentWeapon() == weapon)
391//       {
392//         this->slotConfigs[j]->setNextWeapon(NULL);
393//       }
[4954]394    }
395  }
[10676]396  else {
397
398  }
[4826]399}
400
401
402/**
[4832]403 * changes to the next weapon configuration
[4826]404 */
[4954]405void WeaponManager::nextWeaponConfig()
[4826]406{
[4951]407  ++this->currentConfigID;
408  if (this->currentConfigID >= WM_MAX_CONFIGS)
409    this->currentConfigID = 0;
[4952]410  this->changeWeaponConfig(this->currentConfigID);
411}
[4826]412
[4953]413/**
414 * changes to the previous configuration
415 */
[4952]416void WeaponManager::previousWeaponConfig()
417{
418  --this->currentConfigID;
419  if (this->currentConfigID < 0)
420    this->currentConfigID = WM_MAX_CONFIGS -1;
421  this->changeWeaponConfig(this->currentConfigID);
422}
423
[4953]424/**
425 * change to a desired configuration
426 * @param weaponConfig the configuration to jump to.
427 */
[4952]428void WeaponManager::changeWeaponConfig(int weaponConfig)
429{
430  this->currentConfigID = weaponConfig;
431  PRINTF(4)("Changing weapon configuration: to %i\n", this->currentConfigID);
[10368]432
[4951]433  for (int i = 0; i < WM_MAX_SLOTS; i++)
[10676]434    this->slotConfigs[i]->setNextWeapon(currentConfigID);
[4826]435}
436
437
438/**
[4832]439 * triggers fire of all weapons in the current weaponconfig
[4826]440 */
[4832]441void WeaponManager::fire()
[4826]442{
443  Weapon* firingWeapon;
[4951]444  for(int i = 0; i < this->slotCount; i++)
[4826]445  {
[10368]446//     printf("%i ", i);
[10676]447    firingWeapon = this->slotConfigs[i]->getCurrentWeapon();
[10526]448    if( firingWeapon != NULL)
449    {
450      if( firingWeapon->getCurrentState() == WS_SHOOTING) continue;
451      firingWeapon->requestAction(WA_SHOOT);
452    }
[10368]453  }
454//   printf("\n");
455  /*
[10676]456  this->crosshair->setRotationSpeed(500);
457  this->crossHairSizeAnim->replay();
[10368]458  */
459}
460
461/**
[10539]462 * triggers release fire of all weapons in the current weaponconfig
[10368]463 */
464void WeaponManager::releaseFire()
465{
466  Weapon* firingWeapon;
467  for(int i = 0; i < this->slotCount; i++)
468  {
[10676]469    firingWeapon = this->slotConfigs[i]->getCurrentWeapon();
[10528]470    if( firingWeapon != NULL)
471      firingWeapon->requestAction(WA_NONE);
[4826]472  }
[10368]473
474  /*
[4837]475  this->crosshair->setRotationSpeed(500);
476  this->crossHairSizeAnim->replay();
[10368]477  */
[4826]478}
479
480/**
[4832]481 * triggers tick of all weapons in the current weaponconfig
482 * @param second passed since last tick
[4826]483 */
[4833]484void WeaponManager::tick(float dt)
[4826]485{
[4951]486  Weapon* tickWeapon;
487
488  for(int i = 0; i < this->slotCount; i++)
[4826]489  {
[10368]490    //NICE LITTLE DEBUG FUNCTION
[10676]491    /*   if (this->slotConfigs[i]->currentWeapon != NULL || this->slotConfigs[i]->nextWeapon != NULL)
492      printf("%p %p\n", this->slotConfigs[i]->currentWeapon, this->slotConfigs[i]->nextWeapon);*/
[4951]493
[6736]494    // current Weapon in Slot i
[10676]495    tickWeapon = this->slotConfigs[i]->getCurrentWeapon();
[6736]496    // On A change (current != next)
[10676]497    if (tickWeapon != this->slotConfigs[i]->getNextWeapon())
[4951]498    {
[6736]499      // if a Weapon is Active in slot i, deactivate it.
500      if (tickWeapon != NULL )
[4951]501      {
[6736]502        if (tickWeapon->isActive())
[4953]503        {
[6736]504          tickWeapon->requestAction(WA_DEACTIVATE);
505          continue;
[4953]506        }
[6055]507        else
[6736]508        {
509          tickWeapon->toList(OM_NULL);
[10678]510          this->slotConfigs[i]->setCurrentWeapon(-1);
[6736]511        }
[4951]512      }
[6736]513      // switching to next Weapon
[10676]514//       this->slotConfigs[i]->setCurrentWeapon(this->slotConfigs[i]->getNextWeapon());
515      this->slotConfigs[i]->setNextToCurrent();
516      tickWeapon = this->slotConfigs[i]->getCurrentWeapon();
[10437]517
[6736]518      if (tickWeapon != NULL)
519      {
[10368]520        //if (this->parent != NULL)
521        tickWeapon->toList(this->parentEntity->getOMListNumber());
[6736]522        tickWeapon->requestAction(WA_ACTIVATE);
[10676]523        this->slotConfigs[i]->activateNode();
524        tickWeapon->setParent(this->slotConfigs[i]);
[6736]525      }
526      else
[10676]527        this->slotConfigs[i]->deactivateNode();
[9869]528      if (this->parentEntity != NULL && this->parentEntity->isA(Playable::staticClassID()))
[8844]529        dynamic_cast<Playable*>(this->parentEntity)->weaponConfigChanged();
[4951]530    }
[10544]531    else if (unlikely(tickWeapon != NULL && tickWeapon->getCurrentState() == WS_DEACTIVATING))
[10678]532      this->slotConfigs[i]->setCurrentWeapon(-1);
[4826]533  }
534}
535
536
537/**
[4832]538 * triggers draw of all weapons in the current weaponconfig
[4826]539 */
[4951]540void WeaponManager::draw() const
[4826]541{
[8315]542  assert(false || "must not be called");
[4951]543  Weapon* drawWeapon;
544  for (int i = 0; i < this->slotCount; i++)
[4826]545  {
[10676]546    drawWeapon = this->slotConfigs[i]->getCurrentWeapon();
[4951]547    if( drawWeapon != NULL && drawWeapon->isVisible())
548      drawWeapon->draw();
[4826]549  }
550}
551
552
553/**
[4832]554 * private gets the next free slot in a certain weaponconfig
[6669]555 * @param the selected weaponconfig -1 if none found
[4826]556 */
[5440]557int WeaponManager::getNextFreeSlot(int configID, long capability)
[4826]558{
[6676]559  if (configID == -1)
[4826]560  {
[6676]561    for (configID = 0; configID < WM_MAX_CONFIGS; configID++)
562      for( int i = 0; i < this->slotCount; ++i)
563      {
[10676]564        if( this->slotConfigs[i]->getWeapon(configID) == NULL &&
565            (this->slotConfigs[i]->getCapability() & capability & WTYPE_ALLKINDS) &&
566            (this->slotConfigs[i]->getCapability() & capability & WTYPE_ALLDIRS))
[6676]567          return i;
[6736]568      }
[4826]569  }
[6676]570  else
571  {
572    for( int i = 0; i < this->slotCount; ++i)
573    {
[10676]574      if( this->slotConfigs[i]->getWeapon(configID) == NULL &&
575          (this->slotConfigs[i]->getCapability() & capability & WTYPE_ALLKINDS) &&
576          (this->slotConfigs[i]->getCapability() & capability & WTYPE_ALLDIRS))
[6676]577        return i;
578    }
579  }
[4826]580  return -1;
581}
582
[9869]583CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(const ClassID& projectileType)
[6669]584{
585  for (unsigned int i = 0; i < this->ammo.size(); i++)
586  {
587    if (this->ammo[i]->getProjectileType() == projectileType)
588      return this->ammo[i];
589  }
590  this->ammo.push_back(CountPointer<AmmoContainer>(new AmmoContainer(projectileType)));
591  return this->ammo.back();
592}
[4951]593
[6972]594CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(const Weapon* weapon)
595{
596  assert (weapon != NULL);
[9869]597  return (this->getAmmoContainer(weapon->getClassID()));
[6972]598}
[4951]599
[6972]600
[4953]601/**
602 * outputs some nice debug information about the WeaponManager
603 */
[4951]604void WeaponManager::debug() const
605{
606  PRINT(3)("WeaponManager Debug Information\n");
607  PRINT(3)("-------------------------------\n");
608  PRINT(3)("current Config is %d\n", this->currentConfigID);
609  for (int i = 0; i < WM_MAX_CONFIGS; i++)
610  {
611    PRINT(3)("Listing Weapons in Configuration %d\n", i);
612    for (int j = 0; j < WM_MAX_SLOTS; j++)
613    {
[10676]614      if (this->slotConfigs[j]->getWeapon(i) != NULL)
615        PRINT(3)("Slot %d loaded a %s\n", j, this->slotConfigs[j]->getWeapon(i)->getClassCName());
[4951]616    }
617  }
618}
[10437]619
620
621long WeaponManager::getSlotCapability(int slot) const
622{
[10676]623  return this->slotConfigs[slot]->getCapability();
[10437]624}
625
626const Vector& WeaponManager::getSlotPosition(int slot) const
627{
[10676]628  return this->slotConfigs[slot]->getRelCoor();
[10437]629}
630
631Weapon* WeaponManager::getWeapon(int slotID) const
632{
[10676]633  return (slotID >= 0 && slotID < this->slotCount)? this->slotConfigs[slotID]->getNextWeapon(): NULL;
[10437]634}
635
636
Note: See TracBrowser for help on using the repository browser.