Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2007, 5:10:52 PM (17 years ago)
Author:
nicolasc
Message:

xfer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/vs-enhencements/src/world_entities/weapons/weapon_slot.h

    r10672 r10676  
    99#include "p_node.h"
    1010#include "weapon.h"
     11#include "weapon_manager.h"
    1112
    1213class Weapon;
     
    3132
    3233  inline Weapon* getCurrentWeapon() { return this->currentWeapon; }
    33   inline void setCurrentWeapon(Weapon* weapon) { this->currentWeapon = weapon; }
     34  inline void setCurrentWeapon(int config) { this->currentWeapon = this->configs[config]; }
    3435
    3536  inline Weapon* getNextWeapon() { return this->nextWeapon; }
    36   inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; }
     37  inline void setNextWeapon(int config) { if (config == -1) this->nextWeapon = NULL; else this->nextWeapon = configs[config]; }
    3738
    38   inline void setNextWeapon(const std::string& weaponName){this->nextWeapon = Weapon::createWeapon(weaponName); };
    39   inline void setCurrentWeapon(const std::string& weaponName){ this->currentWeapon = Weapon::createWeapon(weaponName); };
     39  inline void setNextToCurrent() {this->currentWeapon = this->nextWeapon; };
     40//   inline void setNextWeapon(const std::string& weaponName){this->nextWeapon = Weapon::createWeapon(weaponName); };
     41//   inline void setCurrentWeapon(const std::string& weaponName){ this->currentWeapon = Weapon::createWeapon(weaponName); };
    4042
     43  inline void addWeapon(const std::string& weaponName, int config) {this->configs[config] = Weapon::createWeapon(weaponName); }
     44  inline void setWeapon(Weapon* weapon, int config) {this->configs[config] = weapon; };
     45  inline Weapon* getWeapon(int config) { if (config > WM_MAX_CONFIGS) return NULL; return this->configs[config]; };
    4146
    4247  inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; }
     
    4449  inline int getWeaponSide() { return this->weaponSide; }
    4550
     51  void removeWeapon(Weapon* weapon);
    4652
    4753private:
     
    5258  long          capability;             //!< the capabilities of the Slot @see WeaponSlotCapability.
    5359
     60  Weapon*       configs[WM_MAX_CONFIGS];
     61
    5462  Weapon*       currentWeapon;          //!< The current weapon this slot is carrying.
    5563  Weapon*       nextWeapon;             //!< either NULL or the next weapon that will be set (require currentWeapon to deactivate)
     64
     65//   int           currentConfig;
     66//   int           nextConfig;
    5667};
    5768
Note: See TracChangeset for help on using the changeset viewer.