Changeset 11168 for code/branches/tgidronFS16/src/modules
- Timestamp:
- Apr 14, 2016, 4:05:48 PM (9 years ago)
- Location:
- code/branches/tgidronFS16/src/modules
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tgidronFS16/src/modules/hover/CMakeLists.txt
r11035 r11168 17 17 objects 18 18 overlays 19 pickup 19 20 SOURCE_FILES ${Hover_SRC_FILES} 20 21 ) -
code/branches/tgidronFS16/src/modules/hover/Hover.cc
r11163 r11168 62 62 cellHeight = 0; 63 63 64 totFlags = 0; 65 64 66 this->setHUDTemplate("HoverHUD"); 65 67 … … 115 117 116 118 117 //Generate 10 Pickups randomly118 for (int i = 0; i< 10; i++)119 //Generate 5 PickupSpawners randomly 120 for (int i = 0; i<5; i++) 119 121 { 120 122 PickupSpawner* pickup = new PickupSpawner(origin_->getContext()); 121 //PickupSpawner(this->getContext()); 122 //pickup->createDroppedPickup(this->getContext(), pickup , this, 10); 123 pickup->setPosition(rand()%numCells, rand()%numCells, cellSize); 124 //pickup->setPickupTemplateName(origin_->getPickupMeta()); 125 //pickup->setPickupTemplateName("destroymetapickup"); 126 pickup->setMaxSpawnedItems(5); 127 pickup->setRespawnTime(30); 128 pickup->setTriggerDistance(5); 129 //pickup->createDroppedPickup(this->getContext(), pickup , this, 5); 123 130 pickups_.push_back(pickup); 124 131 } 132 125 133 126 134 } … … 138 146 } 139 147 148 //Generate 5 PickupSpawners randomly 149 for (int i = 0; i<5; i++) 150 { 151 PickupSpawner* pickup = new PickupSpawner(origin_->getContext()); 152 //PickupSpawner->setPosition(rand()%numCells, rand()%numCells, cellSize); 153 //pickup->createDroppedPickup(this->getContext(), pickup , this, 5); 154 pickups_.push_back(pickup); 155 } 156 140 157 } 141 158 … … 150 167 flags_[i]->destroyLater(); 151 168 flags_.erase (flags_.begin()+i); 169 totFlags++; 152 170 if(flags_.size()<=0){ 153 171 ChatManager::message("Level Up!"); -
code/branches/tgidronFS16/src/modules/hover/Hover.h
r11163 r11168 79 79 int numCells; 80 80 81 int totFlags; 82 81 83 std::vector<PickupSpawner*> pickups_; 82 84 }; -
code/branches/tgidronFS16/src/modules/hover/HoverOrigin.cc
r11071 r11168 54 54 XMLPortParam(HoverOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode); 55 55 XMLPortParam(HoverOrigin, "cellHeight", setCellHeight, getCellHeight, xmlelement, mode); 56 XMLPortParam(HoverOrigin, "pickuptemplate", setPickup, getPickup, xmlelement, mode); 57 XMLPortParam(HoverOrigin, "pickupbase", setPickupMeta, getPickupMeta, xmlelement, mode); 56 58 } 57 59 -
code/branches/tgidronFS16/src/modules/hover/HoverOrigin.h
r11099 r11168 66 66 { return this->cellHeight_; } 67 67 68 inline void setPickup(std::string pickuptemplate) 69 { this->pickupTemplate_ = pickuptemplate; } 70 inline std::string getPickup() const 71 { return this->pickupTemplate_; } 72 73 inline void setPickupMeta(std::string pickupbase) 74 { this->pickupMeta_ = pickupbase; } 75 inline std::string getPickupMeta() const 76 { return this->pickupMeta_; } 77 68 78 private: 69 79 void checkGametype(); … … 72 82 int cellSize_; 73 83 int cellHeight_; 84 std::string pickupTemplate_; 85 std::string pickupMeta_; 74 86 }; 75 87 } -
code/branches/tgidronFS16/src/modules/pickup/PickupSpawner.h
r11071 r11168 114 114 {return this->pickupTemplate_; } 115 115 116 117 void setPickupTemplateName(const std::string& name); 118 void setPickupTemplate(Template* temp); 119 120 121 /** 122 @brief Set the distance in which to trigger. 123 @param value The new distance in which to trigger. 124 */ 125 inline void setTriggerDistance(float value) 126 { this->triggerDistance_ = value; } 127 /** 128 @brief Set the time to respawn. 129 @param time New time after which this gets re-actived. 130 */ 131 inline void setRespawnTime(float time) 132 { this->respawnTime_ = time; } 133 134 void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items. 135 116 136 private: 117 137 void initialize(void); … … 131 151 { this->blocked_.insert(std::pair<PickupCarrier*, std::time_t>(carrier, std::time(0)+time)); } 132 152 133 /** 134 @brief Set the distance in which to trigger. 135 @param value The new distance in which to trigger. 136 */ 137 inline void setTriggerDistance(float value) 138 { this->triggerDistance_ = value; } 139 /** 140 @brief Set the time to respawn. 141 @param time New time after which this gets re-actived. 142 */ 143 inline void setRespawnTime(float time) 144 { this->respawnTime_ = time; } 153 154 145 155 146 void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.147 148 void setPickupTemplateName(const std::string& name);149 void setPickupTemplate(Template* temp);150 156 151 157 Pickupable* createPickup(void); //!< Creates a new Pickupable.
Note: See TracChangeset
for help on using the changeset viewer.