Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 24, 2005, 12:36:58 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more loadability functionality in Weapon and FastFactory

Location:
orxonox/trunk/src/world_entities/weapons
Files:
3 edited

Legend:

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

    r4949 r4950  
    9696 * sets the Projectile to use for this weapon.
    9797 * @param projectile The ID of the Projectile to use
     98 * @returns true, if it was sucessfull, false on error
    9899 *
    99100 * be aware, that this function does not create Factories, as this is job of Bullet-classes.
     
    117118  }
    118119};
     120
     121/**
     122 * @see bool Weapon::setProjectile(ClassID projectile)
     123 * @param projectile the Name of the Projectile.
     124 * @return true if
     125 */
     126bool Weapon::setProjectile(const char* projectile)
     127{
     128  if (projectile == NULL)
     129    return false;
     130  FastFactory* tmpFac = FastFactory::searchFastFactory(projectile);
     131  if (tmpFac != NULL)
     132  {
     133    this->setProjectile(tmpFac->getStoredID());
     134  }
     135}
    119136
    120137/**
  • orxonox/trunk/src/world_entities/weapons/weapon.h

    r4949 r4950  
    9595    // FUNCTIONS TO SET THE WEAPONS PROPERTIES.
    9696    bool setProjectile(ClassID projectile);
     97    bool setProjectile(const char* projectile);
    9798    /** @returns The projectile's classID */
    9899    inline ClassID getProjectile() { return this->projectile; };
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.h

    r4949 r4950  
    8585{
    8686  int           number;
    87   bool          occupied;
    8887  long          capability;
    8988
Note: See TracChangeset for help on using the changeset viewer.