Changeset 7549 for code/trunk/src/modules/pickup/PickupSpawner.h
- Timestamp:
- Oct 16, 2010, 2:18:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupSpawner.h
r7547 r7549 38 38 #include "PickupPrereqs.h" 39 39 40 #include <map> 40 41 #include <string> 41 42 #include "tools/Timer.h" … … 102 103 inline int getMaxSpawnedItems(void) const 103 104 { return this->maxSpawnedItems_; } 104 105 105 106 106 protected: 107 107 void decrementSpawnsRemaining(void); //!< Decrements the number of remaining spawns. 108 void startRespawnTimer(void); 108 void startRespawnTimer(void); //!< Invoked by the timer, re-activates the PickupSpawner. 109 110 /** 111 @brief Helper method. Adds a PickupCarrier to the list of PickupCarrier that are blocked form getting a Pickupable from the PickupSpawner for a specified time. 112 @param carrier A pointer to the PickupCarrier to be blocked. 113 @param time The time for which the Pawn is blocked. Default is 5. 114 */ 115 void block(PickupCarrier* carrier, unsigned int time = DEFAULT_BLOCKED_TIME) 116 { this->blocked_.insert(std::pair<PickupCarrier*, std::time_t>(carrier, std::time(0)+time)); } 109 117 110 118 /** … … 142 150 float respawnTime_; //!< Time after which this gets re-actived. 143 151 Timer respawnTimer_; //!< Timer used for re-activating. 152 std::map<PickupCarrier*, std::time_t> blocked_; 144 153 145 154 bool selfDestruct_; //!< True if the PickupSpawner is selfdestructing. 146 155 147 156 static const int INF = -1; //!< Constant for infinity. 157 static const unsigned int DEFAULT_BLOCKED_TIME = 5; //!< The default time a PickupCarrier is blocked after picking up a Pickupable. 148 158 }; 149 159 }
Note: See TracChangeset
for help on using the changeset viewer.