Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 23, 2005, 11:17:27 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ProjectileFactory now handled in Weapon-class

File:
1 edited

Legend:

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

    r4934 r4947  
    2020
    2121#include "world_entity.h"
     22#include "fast_factory.h"
    2223
    2324// FORWARD DECLARATION
     
    7980    ////////////////////
    8081
     82    // INTERACTIVITY //
    8183    void requestAction(WeaponAction action);
    8284    float increaseEnergy(float energyToAdd);
     85    ///////////////////
     86
    8387
    8488    /** @returns true if the Weapon is Active  (this is used to check if the weapon must be drawn)*/
     
    8892
    8993    // FUNCTIONS TO SET THE WEAPONS PROPERTIES.
    90     /** @param projectile a projectile for this weapon */
    91     void setProjectile(Projectile* projectile) { this->projectile = projectile; };
    92     /** @returns The projectile if availiable */
    93     Projectile* getProjectile() { return this->projectile; };
     94    bool setProjectile(ClassID projectile);
     95    /** @returns The projectile's classID */
     96    inline ClassID getProjectile() { return this->projectile; };
     97    /** @returns the FastFactory, that creates Projectiles of type getProjectile */
     98    inline FastFactory* getProjectileFactory() { return this->projectileFactory; };
     99
    94100
    95101    void setEmissionPoint(const Vector& point);
     
    188194    bool                 chargeable;                      //!< if the Weapon is charcheable (if true, the weapon will charge before it fires.)
    189195
    190     Projectile*          projectile;                      //!< the projectile used for this weapon
     196    ClassID              projectile;                      //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)
     197    FastFactory*         projectileFactory;               //!< A factory, that produces and handles the projectiles.
    191198  };
    192199
Note: See TracChangeset for help on using the changeset viewer.