Changeset 6405 for code/branches/pickup2/src/modules/pickup/PickupSpawner.h
- Timestamp:
- Dec 23, 2009, 8:27:17 PM (14 years ago)
- 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 35 35 #define _PickupSpawner_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "pickup/PickupPrereqs.h" 38 38 39 39 #include <string> … … 41 41 #include "tools/interfaces/Tickable.h" 42 42 #include "worldentities/StaticEntity.h" 43 #include "interfaces/Pickupable.h" 43 44 44 45 namespace orxonox … … 51 52 { 52 53 public: 53 //TODO: Add limit of items spawned here. Also possibility to spawn collections?54 //TODO: Add limit of items spawned here. 54 55 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); 56 57 virtual ~PickupSpawner(); 57 58 … … 59 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PickupSpawner through XML. 60 61 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() const70 { 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() const78 { return this->itemTemplate_; }79 62 80 63 /** … … 110 93 111 94 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); 113 101 114 102 private: 115 103 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. 116 107 117 std::string itemTemplateName_; //!< Template name of the item to spawn.118 Template* itemTemplate_; //!< Template of the item to spawn.108 109 Pickupable* pickup_; 119 110 120 111 int maxSpawnedItems_; //!< Maximum number of items spawned by this PickupSpawner.
Note: See TracChangeset
for help on using the changeset viewer.