Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2009, 8:27:17 PM (14 years ago)
Author:
dafrick
Message:

Commit changes in pickup before merge.

Location:
code/branches/pickup2/src/modules/pickup
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/pickup2/src/modules/pickup/PickupSpawner.h

    r5953 r6405  
    3535#define _PickupSpawner_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "pickup/PickupPrereqs.h"
    3838
    3939#include <string>
     
    4141#include "tools/interfaces/Tickable.h"
    4242#include "worldentities/StaticEntity.h"
     43#include "interfaces/Pickupable.h"
    4344
    4445namespace orxonox
     
    5152    {
    5253        public:
    53             //TODO: Add limit of items spawned here. Also possibility to spawn collections?
     54            //TODO: Add limit of items spawned here.
    5455            PickupSpawner(BaseObject* creator);
    55             PickupSpawner(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems);
     56            PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems);
    5657            virtual ~PickupSpawner();
    5758
     
    5960            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
    6061            virtual void tick(float dt);
    61 
    62             void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
    63             void respawnTimerCallback();                                    //!< Method called when the timer runs out.
    64 
    65             /**
    66             @brief Get the template name for the item to spawn.
    67             @return Returns the name of the template of the item to spawn.
    68             */
    69             inline const std::string& getItemTemplateName() const
    70                 { return this->itemTemplateName_; }
    71             void setItemTemplateName(const std::string& name);              //!< Set the template name of the item to spawn.
    72 
    73             /**
    74                 @brief Get the template for the item to spawn.
    75                 @return Returns the template of the item to spawn.
    76             */
    77             inline Template* getItemTemplate() const
    78                 { return this->itemTemplate_; }
    7962
    8063            /**
     
    11093
    11194        protected:
    112             virtual BaseItem* getItem(void);
     95            virtual Pickupable* getPickup(void);
     96           
     97            void addPickupable(Pickupable* pickup);
     98            Pickupable* getPickupable(void);
     99           
     100            void decrementSpawnsRemaining(void);
    113101
    114102        private:
    115103            void initialize(void);
     104           
     105            void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
     106            void respawnTimerCallback();                                    //!< Method called when the timer runs out.
    116107
    117             std::string itemTemplateName_;          //!< Template name of the item to spawn.
    118             Template* itemTemplate_;                //!< Template of the item to spawn.
     108           
     109            Pickupable* pickup_;
    119110
    120111            int maxSpawnedItems_;                   //!< Maximum number of items spawned by this PickupSpawner.
Note: See TracChangeset for help on using the changeset viewer.