Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 30, 2009, 2:27:26 PM (16 years ago)
Author:
danielh
Message:

first commit of pickup system

  • working PickupCollection
  • working PickupSpawner
  • base classes for items
  • updated Pawn to include PickupCollection
  • updated Projectile to use damage modifier on hit
Location:
code/branches/pickups/src/orxonox/objects/worldentities/pawns
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickups/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2831 r2864  
    3333#include "core/CoreIncludes.h"
    3434#include "core/XMLPort.h"
    35 #include "util/Exception.h"
    3635#include "util/Math.h"
    3736#include "PawnManager.h"
     
    6261        this->spawnparticleduration_ = 3.0f;
    6362
     63        this->getPickups().setOwner(this);
     64
    6465        if (Core::isMaster())
    6566        {
     
    204205            this->setDestroyWhenPlayerLeft(false);
    205206
     207            this->dropItems();
     208
    206209            if (this->getGametype())
    207210                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
     
    266269    void Pawn::dropItems()
    267270    {
    268         ThrowException(NotImplemented, "Pickupsystem not implemented yet.");
     271        this->getPickups().clear();
    269272    }
    270273
  • code/branches/pickups/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2831 r2864  
    3434#include "objects/RadarViewable.h"
    3535#include "objects/weaponSystem/WeaponSystem.h"
     36#include "objects/pickup/PickupCollection.h"
    3637
    3738namespace orxonox
     
    107108
    108109            virtual void dropItems();
     110            inline PickupCollection& getPickups()
     111                { return this->pickups_; }
    109112
    110113        protected:
     
    115118            bool bAlive_;
    116119
     120            PickupCollection pickups_;
    117121
    118122            float health_;
Note: See TracChangeset for help on using the changeset viewer.