Changeset 6632 for code/branches/pickup4/src/orxonox
- Timestamp:
- Mar 29, 2010, 12:30:32 PM (15 years ago)
- Location:
- code/branches/pickup4/src/orxonox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup4/src/orxonox/CMakeLists.txt
r6524 r6632 58 58 MoodManager.h 59 59 controllers/HumanController.h 60 interfaces/PickupCarrier.h 60 61 sound/SoundManager.h 61 62 DEFINE_SYMBOL -
code/branches/pickup4/src/orxonox/interfaces/InterfaceCompilation.cc
r6534 r6632 60 60 RegisterRootObject(PickupCarrier); 61 61 62 this->setCarrierName("PickupCarrier"); 62 63 } 63 64 -
code/branches/pickup4/src/orxonox/interfaces/PickupCarrier.h
r6563 r6632 45 45 #include "core/OrxonoxClass.h" 46 46 47 namespace orxonox 48 { 49 50 //! Pre-declarations. 47 namespace orxonox // tolua_export 48 { // tolua_export 49 50 //! Forward-declarations. 51 class PickupManager; 51 52 class Pickup; 52 53 class HealthPickup; … … 59 60 Damian 'Mozork' Frick 60 61 */ 61 class _OrxonoxExport PickupCarrier : virtual public OrxonoxClass 62 { 62 class _OrxonoxExport PickupCarrier // tolua_export 63 : virtual public OrxonoxClass 64 { // tolua_export 63 65 //! So that the different Pickupables have full access to their PickupCarrier. 66 friend class Pickupable; 67 friend class PickupManager; 64 68 //! Friends. 65 friend class Pickupable;66 69 friend class Pickup; 67 70 friend class HealthPickup; … … 116 119 117 120 //! Go recursively through all children to check whether they are a target. 118 std:: list<PickupCarrier*>* children = this->getCarrierChildren();119 for(std:: list<PickupCarrier*>::const_iterator it = children->begin(); it != children->end(); it++)121 std::vector<PickupCarrier*>* children = this->getCarrierChildren(); 122 for(std::vector<PickupCarrier*>::const_iterator it = children->begin(); it != children->end(); it++) 120 123 { 121 124 if((*it)->isTarget(pickup)) … … 143 146 144 147 //! Go recursively through all children to check whether they are the target. 145 std:: list<PickupCarrier*>* children = this->getCarrierChildren();146 for(std:: list<PickupCarrier*>::iterator it = children->begin(); it != children->end(); it++)148 std::vector<PickupCarrier*>* children = this->getCarrierChildren(); 149 for(std::vector<PickupCarrier*>::iterator it = children->begin(); it != children->end(); it++) 147 150 { 148 151 if(pickup->isTarget(*it)) … … 162 165 */ 163 166 virtual const Vector3& getCarrierPosition(void) = 0; 167 168 const std::string& getCarrierName(void) { return this->carrierName_; } // tolua_export 164 169 165 170 protected: … … 170 175 @return Returns a pointer to a list of all direct children. 171 176 */ 172 virtual std:: list<PickupCarrier*>* getCarrierChildren(void) = 0;177 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) = 0; 173 178 /** 174 179 @brief Get the parent of this PickupSpawner … … 184 189 std::set<Pickupable*>& getPickups(void) 185 190 { return this->pickups_; } 191 192 void setCarrierName(const std::string& name) 193 { this->carrierName_ = name; } 186 194 187 195 private: 188 196 std::set<Pickupable*> pickups_; //!< The list of Pickupables carried by this PickupCarrier. 189 190 }; 191 } 197 std::string carrierName_; 198 199 unsigned int getNumCarrierChildren(void) 200 { 201 std::vector<PickupCarrier*>* list = this->getCarrierChildren(); 202 unsigned int size = list->size(); 203 delete list; 204 return size; 205 } 206 207 PickupCarrier* getCarrierChild(unsigned int index) 208 { 209 std::vector<PickupCarrier*>* list = this->getCarrierChildren(); 210 if(list->size() < index) 211 return NULL; 212 PickupCarrier* carrier = (*list)[index]; 213 delete list; 214 return carrier; 215 } 216 217 Pickupable* getPickup(unsigned int index) 218 { 219 std::set<Pickupable*>::iterator it; 220 for(it = this->pickups_.begin(); index != 0 && it != this->pickups_.end(); it++) 221 index--; 222 if(it == this->pickups_.end()) 223 return NULL; 224 return *it; 225 } 226 227 unsigned int getNumPickups(void) 228 { return this->pickups_.size(); } 229 230 231 }; // tolua_export 232 } // tolua_export 192 233 193 234 #endif /* _PickupCarrier_H__ */ -
code/branches/pickup4/src/orxonox/overlays/OrxonoxOverlay.cc
r6502 r6632 327 327 { 328 328 OrxonoxOverlay* overlay= it->second; 329 COUT(1) << "MUP" << std::endl; 329 330 if(overlay->isVisible()) 331 { 330 332 overlay->hide(); 333 COUT(1) << "HIDE " << name << std::endl; 334 } 331 335 else 336 { 332 337 overlay->show(); 338 COUT(1) << "SHOW " << name << std::endl; 339 } 333 340 } 334 341 } -
code/branches/pickup4/src/orxonox/worldentities/pawns/Pawn.h
r6540 r6632 37 37 #include "worldentities/ControllableEntity.h" 38 38 39 namespace orxonox 40 { 41 class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable, public PickupCarrier 42 { 39 namespace orxonox // tolua_export 40 { // tolua_export 41 class _OrxonoxExport Pawn // tolua_export 42 : public ControllableEntity, public RadarViewable, public PickupCarrier 43 { // tolua_export 43 44 friend class WeaponSystem; 44 45 … … 132 133 bool bAlive_; 133 134 134 virtual std:: list<PickupCarrier*>* getCarrierChildren(void)135 { return new std:: list<PickupCarrier*>(); }135 virtual std::vector<PickupCarrier*>* getCarrierChildren(void) 136 { return new std::vector<PickupCarrier*>(); } 136 137 virtual PickupCarrier* getCarrierParent(void) 137 138 { return NULL; } … … 155 156 156 157 Vector3 aimPosition_; 157 }; 158 } 158 }; // tolua_export 159 } // tolua_export 159 160 160 161 #endif /* _Pawn_H__ */
Note: See TracChangeset
for help on using the changeset viewer.