Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9685 in orxonox.OLD for branches/new_class_id/src/world_entities


Ignore:
Timestamp:
Aug 22, 2006, 1:16:23 PM (18 years ago)
Author:
bensch
Message:

adapted many classes to the new ClassID System, now comes the hard part… Scripting… then Network… wow this will be so bad :/

Location:
branches/new_class_id/src/world_entities
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/Makefile.am

    r8994 r9685  
    2121                projectiles/projectile.cc \
    2222                \
     23                extendable.cc \
    2324                power_ups/power_up.cc \
    2425                power_ups/param_power_up.cc \
  • branches/new_class_id/src/world_entities/extendable.cc

    r9683 r9685  
    1 /*!
    2  * @file proto_class.h
    3  * @brief Interface for Worldentities that can picku up powerups.
    4 */
     1#include "extendable.h"
    52
    6 #ifndef _EXTENDABLE_H
    7 #define _EXTENDABLE_H
    8 
    9 #include "base_object.h"
    10 
    11 // FORWARD DECLARATION
    12 class PowerUp;
    13 
    14 #include "power_ups/power_up.h"
    15 
    16 //! A class for ...
    17 class Extendable : virtual public BaseObject {
    18 
    19   public:
    20    //   virtual ~Extendable();
    21    virtual bool pickup(PowerUp* powerUp) { return false; };
    22 
    23   protected:
    24     Extendable() { this->setClassID(CL_EXTENDABLE, "Extendable"); };
    25 
    26   private:
    27 
    28 };
    29 
    30 #endif /* _EXTENDABLE_H */
     3NewObjectListDefinition(Extendable);
  • branches/new_class_id/src/world_entities/extendable.h

    r6282 r9685  
    11/*!
    2  * @file proto_class.h
    3  * @brief Interface for Worldentities that can picku up powerups.
     2 * @file extendable.h
     3 * @brief Interface for Worldentities that can pick up powerups.
    44*/
    55
     
    1212class PowerUp;
    1313
     14
    1415#include "power_ups/power_up.h"
    15 
    16 //! A class for ...
     16//! A class for Extendable Entities
    1717class Extendable : virtual public BaseObject {
     18  NewObjectListDeclaration(Extendable);
    1819
    1920  public:
    20    //   virtual ~Extendable();
    2121   virtual bool pickup(PowerUp* powerUp) { return false; };
    2222
    2323  protected:
    24     Extendable() { this->setClassID(CL_EXTENDABLE, "Extendable"); };
    25 
    26   private:
    27 
     24    Extendable() { this->registerObject(this, Extendable::_objectList); };
    2825};
    2926
  • branches/new_class_id/src/world_entities/weapons/ammo_container.h

    r9684 r9685  
    1919
    2020 public:
    21   AmmoContainer(ClassID projectileType, float maxEnergy = DEFAULT_MAX_ENERGY);
     21  AmmoContainer(NewClassID id, float maxEnergy = DEFAULT_MAX_ENERGY);
    2222  virtual ~AmmoContainer();
    2323
    2424  bool operator=(int projectileType) const { return (this->projectileType == projectileType); };
    25   ClassID getProjectileType() const { return this->projectileType; };
     25  NewClassID getProjectileType() const { return this->projectileType; };
    2626
    2727  float increaseEnergy(float energy);
     
    4141   float  maxEnergy;
    4242
    43    ClassID projectileType;
     43   NewClassID projectileType;
    4444};
    4545
  • branches/new_class_id/src/world_entities/weapons/weapon.h

    r8976 r9685  
    8787    Weapon ();
    8888    virtual ~Weapon ();
    89     static Weapon* createWeapon(ClassID weaponID);
     89    static Weapon* createWeapon(NewClassID weaponID);
    9090
    9191    void init();
     
    110110    /** @returns the Capabilities of this Weapon */
    111111    inline long getCapability() const { return this->capability; };
    112     void setProjectileType(ClassID projectile);
     112    void setProjectileType(NewClassID projectile);
    113113    void setProjectileTypeC(const std::string& projectile);
    114114    /** @returns The projectile's classID */
    115     inline ClassID getProjectileType() { return this->projectile; };
     115    inline NewClassID getProjectileType() { return this->projectile; };
    116116    /** @returns the FastFactory, that creates Projectiles of type getProjectile */
    117117    inline FastFactory* getProjectileFactory() { return this->projectileFactory; };
     
    230230    bool                   chargeable;                      //!< if the Weapon is charcheable (if true, the weapon will charge before it fires.)
    231231
    232     ClassID                projectile;                      //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)
     232    NewClassID                projectile;                      //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)
    233233    FastFactory*           projectileFactory;               //!< A factory, that produces and handles the projectiles.
    234234  };
  • branches/new_class_id/src/world_entities/weapons/weapon_manager.h

    r8844 r9685  
    8989    void changeWeaponConfig(int weaponConfig);
    9090
    91     float increaseAmmunition(ClassID projectileType, float ammo);
     91    float increaseAmmunition(NewClassID projectileType, float ammo);
    9292    float inclreaseAmmunition(const Weapon* weapon, float ammo);
    9393
     
    106106 // private:
    107107    int getNextFreeSlot(int configID, long capability = WTYPE_ALL);
    108     CountPointer<AmmoContainer>& getAmmoContainer(ClassID projectileType);
     108    CountPointer<AmmoContainer>& getAmmoContainer(NewClassID projectileType);
    109109    CountPointer<AmmoContainer>& getAmmoContainer(const Weapon* weapon);
    110110
Note: See TracChangeset for help on using the changeset viewer.