Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4759 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons


Ignore:
Timestamp:
Jul 1, 2005, 11:51:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: version finaly changed to 0.3.0… how could i forget ….

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/weapon.h

    r4758 r4759  
    3737#define W_MAX_CONFIGS 4
    3838
     39
     40// FORWARD DECLARATION
    3941class Projectile;
    4042class Weapon;
    4143class Animation3D;
     44class TiXmlElement;
    4245
    4346typedef enum {
    44   SHOOT,
    45   EMPTY,
    46   RELOAD,
    47   SPECIAL1,
    48   SPECIAL2,
    49   SPECIAL3
    50 } weaponSoundType;
     47  W_SHOOT,
     48  W_EMPTY,
     49  W_RELOAD,
     50  W_SPECIAL1,
     51  W_SPECIAL2,
     52  W_SPECIAL3
     53} WeaponSoundType;
    5154
    5255
    5356//! this is an identifier for the slot. there are up to 8 weapon slots -> this means there can't be more than 8 weapons at the same time
    54 #define W_SLOT0 0
    55 #define W_SLOT1 1
    56 #define W_SLOT2 2
    57 #define W_SLOT3 3
    58 #define W_SLOT4 4
    59 #define W_SLOT5 5
    60 #define W_SLOT6 6
    61 #define W_SLOT7 7
    62 #define W_FREE_SLOT 99
     57#define    W_SLOT0      0
     58#define    W_SLOT1      1
     59#define    W_SLOT2      2
     60#define    W_SLOT3      3
     61#define    W_SLOT4      4
     62#define    W_SLOT5      5
     63#define    W_SLOT6      6
     64#define    W_SLOT7      7
     65#define    W_FREE_SLOT  99
    6366
    6467
    6568//! this is an identifier for the weapon config
    66 #define W_CONFIG0 0
    67 #define W_CONFIG1 1
    68 #define W_CONFIG2 2
    69 #define W_CONFIG3 3
     69#define    W_CONFIG0    0
     70#define    W_CONFIG1    1
     71#define    W_CONFIG2    2
     72#define    W_CONFIG3    3
    7073
    7174//! a weapon can be left or right sided
    72 #define W_LEFT 0
    73 #define W_RIGHT 1
     75#define    W_LEFT        0
     76#define    W_RIGHT      1
    7477
    7578//! this is a weapon Configuration: it has up to 8 slots
    7679typedef struct weaponConfig {
    77   bool bUsed;                       //<! is set to true, if this configuration is
    78   Weapon* slots[8];
     80  bool           bUsed;                       //<! is set to true, if this configuration is
     81  Weapon*        slots[8];
    7982};
    8083
     
    8386 public:
    8487  WeaponManager(int nrOfSlots = 2);
     88  WeaponManager(const TiXmlElement* root);
    8589  ~WeaponManager();
     90
     91  void init();
     92  void loadParams(const TiXmlElement* root);
    8693
    8794  void addWeapon(Weapon* weapon, int configID = W_CONFIG0, int slotID = W_FREE_SLOT);
     
    94101
    95102 private:
    96   int nrOfSlots;                        //<! number of weapon slots a ship has
    97   int currConfID;                       //<! the currently selected config
    98   weaponConfig configs[4];              //<! a list of four configurations
     103  int                   nrOfSlots;               //<! number of weapon slots a ship has
     104  int                   currConfID;              //<! the currently selected config
     105  weaponConfig          configs[4];              //<! a list of four configurations
    99106
    100107  int getNextFreeSlot(int configID);
     
    107114 public:
    108115  Weapon (PNode* parent, const Vector& coordinate, const Quaternion& direction);
     116  Weapon(const TiXmlElement* root);
    109117  virtual ~Weapon ();
     118
     119  void init();
     120  void loadParams(const TiXmlElement* root);
    110121
    111122  void enable();
     
    122133
    123134  /**
    124      \brief sets a weapon idle time
     135     \brief sets a weapons idle time
    125136     \param idle time in ms
    126137
     
    132143     \brief gets the weapon idle time
    133144     \returns idle time in ms
    134 
    135      a weapon idle time is the time spend after a shoot until the weapon can
    136      shoot again
    137   */
     145   */
    138146  inline float getWeaponIdleTime() const { return this->idleTime;}
    139147  /**
Note: See TracChangeset for help on using the changeset viewer.