Changeset 9715 in orxonox.OLD for branches/new_class_id/src/world_entities/weapons
- Timestamp:
- Sep 1, 2006, 8:06:39 PM (18 years ago)
- Location:
- branches/new_class_id/src/world_entities/weapons
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/world_entities/weapons/aim.cc
r9709 r9715 29 29 30 30 31 NewObjectListDefinition(Aim);31 ObjectListDefinition(Aim); 32 32 33 33 /** -
branches/new_class_id/src/world_entities/weapons/aim.h
r9709 r9715 29 29 class Aim : public PNode, public Element2D 30 30 { 31 NewObjectListDeclaration(Aim);31 ObjectListDeclaration(Aim); 32 32 33 33 public: -
branches/new_class_id/src/world_entities/weapons/aiming_system.cc
r9709 r9715 30 30 31 31 32 NewObjectListDefinition(AimingSystem);32 ObjectListDefinition(AimingSystem); 33 33 34 34 /** -
branches/new_class_id/src/world_entities/weapons/aiming_system.h
r9709 r9715 21 21 class AimingSystem : public WorldEntity 22 22 { 23 NewObjectListDeclaration(AimingSystem);23 ObjectListDeclaration(AimingSystem); 24 24 25 25 public: -
branches/new_class_id/src/world_entities/weapons/aiming_turret.cc
r9709 r9715 28 28 29 29 #include "class_id.h" 30 NewObjectListDefinitionID(AimingTurret, CL_AIMING_TURRET);30 ObjectListDefinitionID(AimingTurret, CL_AIMING_TURRET); 31 31 CREATE_FACTORY(AimingTurret); 32 32 -
branches/new_class_id/src/world_entities/weapons/aiming_turret.h
r9709 r9715 13 13 class AimingTurret : public Weapon 14 14 { 15 NewObjectListDeclaration(AimingTurret);15 ObjectListDeclaration(AimingTurret); 16 16 17 17 public: -
branches/new_class_id/src/world_entities/weapons/ammo_container.cc
r9705 r9715 23 23 24 24 25 NewObjectListDefinition(AmmoContainer);25 ObjectListDefinition(AmmoContainer); 26 26 /** 27 27 * standard constructor 28 28 * @todo this constructor is not jet implemented - do it 29 29 */ 30 AmmoContainer::AmmoContainer (const NewClassID& projectileType, float maxEnergy)30 AmmoContainer::AmmoContainer (const ClassID& projectileType, float maxEnergy) 31 31 { 32 32 this->registerObject(this, AmmoContainer::_objectList); -
branches/new_class_id/src/world_entities/weapons/ammo_container.h
r9705 r9715 17 17 //! A class for Storing energy of Projectiles. 18 18 class AmmoContainer : public BaseObject { 19 NewObjectListDeclaration(AmmoContainer);19 ObjectListDeclaration(AmmoContainer); 20 20 21 21 public: 22 AmmoContainer(const NewClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY);22 AmmoContainer(const ClassID& id, float maxEnergy = DEFAULT_MAX_ENERGY); 23 23 virtual ~AmmoContainer(); 24 24 25 25 bool operator=(int projectileType) const { return (this->projectileType == projectileType); }; 26 NewClassID getProjectileType() const { return this->projectileType; };26 ClassID getProjectileType() const { return this->projectileType; }; 27 27 28 28 float increaseEnergy(float energy); … … 42 42 float maxEnergy; 43 43 44 NewClassID projectileType;44 ClassID projectileType; 45 45 }; 46 46 -
branches/new_class_id/src/world_entities/weapons/boomerang_gun.cc
r9709 r9715 28 28 29 29 #include "class_id.h" 30 NewObjectListDefinitionID(BoomerangGun, CL_BOOMERANG_GUN);30 ObjectListDefinitionID(BoomerangGun, CL_BOOMERANG_GUN); 31 31 CREATE_FACTORY(BoomerangGun); 32 32 -
branches/new_class_id/src/world_entities/weapons/boomerang_gun.h
r9709 r9715 11 11 class BoomerangGun : public Weapon 12 12 { 13 NewObjectListDeclaration(BoomerangGun);13 ObjectListDeclaration(BoomerangGun); 14 14 public: 15 15 BoomerangGun (); -
branches/new_class_id/src/world_entities/weapons/cannon.cc
r9709 r9715 37 37 38 38 #include "class_id.h" 39 NewObjectListDefinitionID(Cannon, CL_CANNON);39 ObjectListDefinitionID(Cannon, CL_CANNON); 40 40 CREATE_FACTORY(Cannon); 41 41 -
branches/new_class_id/src/world_entities/weapons/cannon.h
r9709 r9715 12 12 class Cannon : public Weapon 13 13 { 14 NewObjectListDeclaration(Cannon);14 ObjectListDeclaration(Cannon); 15 15 public: 16 16 Cannon (); -
branches/new_class_id/src/world_entities/weapons/crosshair.cc
r9705 r9715 26 26 27 27 28 NewObjectListDefinition(Crosshair);28 ObjectListDefinition(Crosshair); 29 29 /** 30 30 * standart constructor -
branches/new_class_id/src/world_entities/weapons/crosshair.h
r9705 r9715 22 22 //! A class that enables the 23 23 class Crosshair : public PNode, public Element2D, public EventListener { 24 NewObjectListDeclaration(Crosshair);24 ObjectListDeclaration(Crosshair); 25 25 public: 26 26 Crosshair(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/weapons/fps_sniper_rifle.cc
r9709 r9715 40 40 41 41 #include "class_id.h" 42 NewObjectListDefinitionID(FPSSniperRifle, CL_FPS_SNIPER_RIFLE);42 ObjectListDefinitionID(FPSSniperRifle, CL_FPS_SNIPER_RIFLE); 43 43 CREATE_FACTORY(FPSSniperRifle); 44 44 -
branches/new_class_id/src/world_entities/weapons/fps_sniper_rifle.h
r9709 r9715 39 39 class FPSSniperRifle : public Weapon 40 40 { 41 NewObjectListDeclaration(FPSSniperRifle);41 ObjectListDeclaration(FPSSniperRifle); 42 42 43 43 public: -
branches/new_class_id/src/world_entities/weapons/hyperblaster.cc
r9709 r9715 36 36 37 37 #include "class_id.h" 38 NewObjectListDefinitionID(Hyperblaster, CL_HYPERBLASTER);38 ObjectListDefinitionID(Hyperblaster, CL_HYPERBLASTER); 39 39 CREATE_FACTORY(Hyperblaster); 40 40 -
branches/new_class_id/src/world_entities/weapons/hyperblaster.h
r9709 r9715 12 12 class Hyperblaster : public Weapon 13 13 { 14 NewObjectListDeclaration(Hyperblaster);14 ObjectListDeclaration(Hyperblaster); 15 15 public: 16 16 Hyperblaster (const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/weapons/laser_cannon.cc
r9709 r9715 32 32 33 33 #include "class_id.h" 34 NewObjectListDefinitionID(LaserCannon, CL_LASER_CANNON);34 ObjectListDefinitionID(LaserCannon, CL_LASER_CANNON); 35 35 CREATE_FACTORY(LaserCannon); 36 36 -
branches/new_class_id/src/world_entities/weapons/laser_cannon.h
r9709 r9715 29 29 class LaserCannon : public Weapon 30 30 { 31 NewObjectListDeclaration(LaserCannon);31 ObjectListDeclaration(LaserCannon); 32 32 public: 33 33 LaserCannon (const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/weapons/targeting_turret.cc
r9709 r9715 27 27 28 28 #include "class_id.h" 29 NewObjectListDefinitionID(TargetingTurret, CL_TARGETING_TURRET);29 ObjectListDefinitionID(TargetingTurret, CL_TARGETING_TURRET); 30 30 CREATE_FACTORY(TargetingTurret); 31 31 -
branches/new_class_id/src/world_entities/weapons/targeting_turret.h
r9709 r9715 12 12 class TargetingTurret : public Weapon 13 13 { 14 NewObjectListDeclaration(TargetingTurret);14 ObjectListDeclaration(TargetingTurret); 15 15 public: 16 16 TargetingTurret(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/weapons/test_gun.cc
r9709 r9715 34 34 35 35 #include "class_id.h" 36 NewObjectListDefinitionID(TestGun, CL_TEST_GUN);36 ObjectListDefinitionID(TestGun, CL_TEST_GUN); 37 37 CREATE_FACTORY(TestGun); 38 38 /** -
branches/new_class_id/src/world_entities/weapons/test_gun.h
r9709 r9715 37 37 class TestGun : public Weapon 38 38 { 39 NewObjectListDeclaration(TestGun);39 ObjectListDeclaration(TestGun); 40 40 public: 41 41 TestGun (int leftRight); -
branches/new_class_id/src/world_entities/weapons/turret.cc
r9709 r9715 28 28 29 29 #include "class_id.h" 30 NewObjectListDefinitionID(Turret, CL_TURRET);30 ObjectListDefinitionID(Turret, CL_TURRET); 31 31 CREATE_FACTORY(Turret); 32 32 -
branches/new_class_id/src/world_entities/weapons/turret.h
r9709 r9715 11 11 class Turret : public Weapon 12 12 { 13 NewObjectListDeclaration(Turret);13 ObjectListDeclaration(Turret); 14 14 public: 15 15 Turret (); -
branches/new_class_id/src/world_entities/weapons/weapon.cc
r9709 r9715 35 35 #include "elements/glgui_energywidget.h" 36 36 37 NewObjectListDefinition(Weapon);37 ObjectListDefinition(Weapon); 38 38 39 39 //////////////////// … … 72 72 * @returns the newly created Weapon. 73 73 */ 74 Weapon* Weapon::createWeapon(const NewClassID& weaponID)74 Weapon* Weapon::createWeapon(const ClassID& weaponID) 75 75 { 76 76 BaseObject* createdObject = Factory::fabricate(weaponID); … … 179 179 * What it does, is telling the Weapon what Projectiles it can Emit. 180 180 */ 181 void Weapon::setProjectileType(const NewClassID& projectile)181 void Weapon::setProjectileType(const ClassID& projectile) 182 182 { 183 183 this->projectile = projectile; -
branches/new_class_id/src/world_entities/weapons/weapon.h
r9705 r9715 83 83 class Weapon : public WorldEntity 84 84 { 85 NewObjectListDeclaration(Weapon);85 ObjectListDeclaration(Weapon); 86 86 87 87 public: … … 89 89 Weapon (); 90 90 virtual ~Weapon (); 91 static Weapon* createWeapon(const NewClassID& weaponID);91 static Weapon* createWeapon(const ClassID& weaponID); 92 92 static Weapon* createWeapon(const std::string& weaponName); 93 93 … … 113 113 /** @returns the Capabilities of this Weapon */ 114 114 inline long getCapability() const { return this->capability; }; 115 void setProjectileType(const NewClassID& projectile);115 void setProjectileType(const ClassID& projectile); 116 116 void setProjectileTypeC(const std::string& projectile); 117 117 /** @returns The projectile's classID */ 118 inline NewClassID getProjectileType() { return this->projectile; };118 inline ClassID getProjectileType() { return this->projectile; }; 119 119 /** @returns the FastFactory, that creates Projectiles of type getProjectile */ 120 120 inline FastFactory* getProjectileFactory() { return this->projectileFactory; }; … … 233 233 bool chargeable; //!< if the Weapon is charcheable (if true, the weapon will charge before it fires.) 234 234 235 NewClassID projectile; //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)235 ClassID projectile; //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.) 236 236 FastFactory* projectileFactory; //!< A factory, that produces and handles the projectiles. 237 237 }; -
branches/new_class_id/src/world_entities/weapons/weapon_manager.cc
r9705 r9715 31 31 32 32 33 NewObjectListDefinition(WeaponManager);33 ObjectListDefinition(WeaponManager); 34 34 /** 35 35 * @brief this initializes the weaponManager for a given nnumber of weapon slots … … 311 311 * @param ammo the ammo to increase 312 312 */ 313 float WeaponManager::increaseAmmunition(const NewClassID& projectileType, float ammo)313 float WeaponManager::increaseAmmunition(const ClassID& projectileType, float ammo) 314 314 { 315 315 return this->getAmmoContainer(projectileType)->increaseEnergy(ammo); … … 523 523 } 524 524 525 CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(const NewClassID& projectileType)525 CountPointer<AmmoContainer>& WeaponManager::getAmmoContainer(const ClassID& projectileType) 526 526 { 527 527 for (unsigned int i = 0; i < this->ammo.size(); i++) -
branches/new_class_id/src/world_entities/weapons/weapon_manager.h
r9705 r9715 39 39 */ 40 40 class WeaponManager : public BaseObject { 41 NewObjectListDeclaration(WeaponManager);41 ObjectListDeclaration(WeaponManager); 42 42 43 43 //! an enumerator defining a Slot, where a Weapon can be stored inside. … … 90 90 void changeWeaponConfig(int weaponConfig); 91 91 92 float increaseAmmunition(const NewClassID& projectileType, float ammo);92 float increaseAmmunition(const ClassID& projectileType, float ammo); 93 93 float inclreaseAmmunition(const Weapon* weapon, float ammo); 94 94 … … 107 107 // private: 108 108 int getNextFreeSlot(int configID, long capability = WTYPE_ALL); 109 CountPointer<AmmoContainer>& getAmmoContainer(const NewClassID& projectileType);109 CountPointer<AmmoContainer>& getAmmoContainer(const ClassID& projectileType); 110 110 CountPointer<AmmoContainer>& getAmmoContainer(const Weapon* weapon); 111 111
Note: See TracChangeset
for help on using the changeset viewer.