Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 18, 2009, 6:14:52 PM (16 years ago)
Author:
landauf
Message:

Added many new features in the Munition class:

  • there are now 3 modes: a) every weapon has it's own magazine b) all weapons use the same magazin c) no magazines, just a big munition pool
  • the Munition class handles the reloading of the magazine

Split the Weapon class into Weapon and WeaponMode. WeaponMode creates the fire of the Weapon. A weapon can own several WeaponModes (for example primary and secondary fire). But it's also possible to have a weapon with several muzzles which all fire at the same time (there's a WeaponMode for each muzzle).

Renamed LaserGun to LaserFire and Fusion to FusionFire. They inherit now from WeaponMode.

Changed the code in the Weapon class to use the new Munition functionality.

Added ReplenishingMunition, a subclass of Munition that replenishes itself (used for LaserGunMunition).

Added a reload command to reload magazines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapons/src/orxonox/objects/weaponSystem/WeaponSystem.h

    r2915 r2918  
    6969
    7070            void fire(unsigned int firemode);
     71            void reload();
    7172
    72 
    73             void setNewMunition(const std::string& munitionType, Munition * munitionToAdd);
    74             void setNewSharedMunition(const std::string& munitionType, Munition * munitionToAdd);
    75             Munition * getMunitionType(const std::string& munitionType) const;
     73            Munition * getMunition(SubclassIdentifier<Munition> * identifier);
    7674
    7775            inline void setPawn(Pawn * pawn)
     
    9694            std::vector<WeaponSlot *> weaponSlots_;
    9795            std::set<WeaponPack *> weaponPacks_;
    98             std::map<std::string, Munition *> munitionSet_;
     96            std::map<Identifier *, Munition *> munitions_;
    9997            Pawn * pawn_;
    10098    };
Note: See TracChangeset for help on using the changeset viewer.