Changeset 6540 for code/trunk/src/orxonox
- Timestamp:
- Mar 16, 2010, 9:35:11 PM (15 years ago)
- Location:
- code/trunk/src/orxonox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/interfaces/PickupCarrier.h
r6533 r6540 28 28 29 29 /** 30 @file 30 @file PickupCarrier.h 31 31 @brief Definition of the PickupCarrier class. 32 32 */ … … 48 48 { 49 49 50 //! Pre-declarations. 50 51 class Pickup; 51 52 class HealthPickup; … … 60 61 class _OrxonoxExport PickupCarrier : virtual public OrxonoxClass 61 62 { 62 friend class Pickupable; //!< The Pickupable has full acces to itsPickupCarrier.63 //TODO: Ugly workaround.63 //! So that the different Pickupables have full access to their PickupCarrier. 64 friend class Pickupable; 64 65 friend class Pickup; 65 66 friend class HealthPickup; … … 108 109 @return Returns true if the PickupCarrier or one of its children is a target, false if not. 109 110 */ 110 //TODO: Use?111 111 bool isTarget(const Pickupable* pickup) 112 112 { … … 154 154 return NULL; 155 155 } 156 157 /** 158 @brief Get the (absolute) position of the PickupCarrier. 159 This method needs to be implemented by any direct derivative class of PickupCarrier. 160 @return Returns the position as a Vector3. 161 */ 162 virtual const Vector3& getCarrierPosition(void) = 0; 156 163 157 164 protected: … … 159 166 @brief Get all direct children of this PickupSpawner. 160 167 This method needs to be implemented by any direct derivative class of PickupCarrier. 168 The returned list will be deleted by the methods calling this function. 161 169 @return Returns a pointer to a list of all direct children. 162 170 */ 163 //TODO: Good return type? Maybe not const and destroyed in isTarget...164 171 virtual std::list<PickupCarrier*>* getCarrierChildren(void) = 0; 165 172 /** … … 169 176 */ 170 177 virtual PickupCarrier* getCarrierParent(void) = 0; 171 /**172 @brief Get the (absolute) position of the PickupCarrier.173 This method needs to be implemented by any direct derivative class of PickupCarrier.174 @return Returns the position as a Vector3.175 */176 virtual const Vector3& getCarrierPosition(void) = 0;177 178 178 179 /** -
code/trunk/src/orxonox/interfaces/Pickupable.cc
r6538 r6540 46 46 Constructor. Registers the objects and initializes its member variables. 47 47 */ 48 Pickupable::Pickupable() 49 { 50 this->used_ = false; 51 this->pickedUp_ = false; 52 48 Pickupable::Pickupable() : used_(false), pickedUp_(false) 49 { 53 50 RegisterRootObject(Pickupable); 54 51 … … 231 228 this->setPickedUp(false); 232 229 233 bool created = this->createSpawner( this->getCarrier()->getCarrierPosition());230 bool created = this->createSpawner(); 234 231 235 232 this->setCarrier(NULL); 236 //TODO: possible problem.233 237 234 if(!created) 238 235 { … … 267 264 A reference to a pointer to the OrxonoxClass that is to be duplicated. 268 265 */ 269 //TODO: Specify how the implementation must be done in detail.270 266 void Pickupable::clone(OrxonoxClass*& item) 271 267 { -
code/trunk/src/orxonox/interfaces/Pickupable.h
r6539 r6540 51 51 Damian 'Mozork' Frick 52 52 */ 53 //TODO: Add stuff like weight/space ?54 53 class _OrxonoxExport Pickupable : virtual public OrxonoxClass 55 54 { 55 protected: 56 Pickupable(); //!< Default constructor. 56 57 57 58 public: 58 Pickupable(); //!< Default constructor.59 59 virtual ~Pickupable(); //!< Default destructor. 60 60 … … 113 113 { return this->pickupIdentifier_; } 114 114 115 //TODO: Make them work as protected.116 115 bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input. 117 116 bool setPickedUp(bool pickedUp); //!< Helper method to set the Pickupable to either picked up or not picked up. … … 131 130 @return Returns true if a spawner was created, false if not. 132 131 */ 133 virtual bool createSpawner( const Vector3& position) = 0;132 virtual bool createSpawner(void) = 0; 134 133 135 //TODO: Move to private and create get method in protected.136 134 PickupIdentifier* pickupIdentifier_; //!< The PickupIdentifier of this Pickupable. 137 135 -
code/trunk/src/orxonox/items/Engine.cc
r6524 r6540 35 35 #include "Scene.h" 36 36 #include "worldentities/pawns/SpaceShip.h" 37 //TODO: Remove.38 //#include "pickup/ModifierType.h"39 37 #include "tools/Shader.h" 40 38 … … 194 192 } 195 193 196 //TODO: Correct?197 194 this->ship_->setAcceleration(this->ship_->getOrientation() * acceleration); 198 195 -
code/trunk/src/orxonox/pickup/PickupIdentifier.cc
r6524 r6540 26 26 * 27 27 */ 28 29 /** 30 @file PickupIdentifier.cc 31 @brief Implementation of the PickupIdentifier class. 32 */ 28 33 29 34 #include "PickupIdentifier.h" -
code/trunk/src/orxonox/pickup/PickupIdentifier.h
r6524 r6540 26 26 * 27 27 */ 28 29 /** 30 @file PickupIdentifier.h 31 @brief Definition of the PickupIdentifier class. 32 */ 28 33 29 34 #ifndef _PickupIdentifier_H__ -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r6524 r6540 71 71 this->aimPosition_ = Vector3::ZERO; 72 72 73 //TODO: Remove.74 //this->getPickups().setOwner(this);75 76 73 if (GameMode::isMaster()) 77 74 { … … 297 294 } 298 295 299 //TODO: Remove.300 // void Pawn::dropItems()301 // {302 // this->getPickups().clear();303 // }304 305 306 296 /* WeaponSystem: 307 297 * functions load Slot, Set, Pack from XML and make sure all parent-pointers are set. -
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
r6524 r6540 109 109 { return this->numexplosionchunks_; } 110 110 111 //TODO: Remove.112 // virtual void dropItems();113 // inline PickupCollection& getPickups()114 // { return this->pickups_; }115 // virtual void useItem()116 // { this->pickups_.useItem(); }117 118 111 virtual void startLocalHumanControl(); 119 112 … … 122 115 Vector3 getAimPosition() 123 116 { return this->aimPosition_; } 117 118 virtual const Vector3& getCarrierPosition(void) 119 { return this->getWorldPosition(); }; 124 120 125 121 protected: … … 136 132 bool bAlive_; 137 133 138 //TODO: Remove.139 //PickupCollection pickups_;140 134 virtual std::list<PickupCarrier*>* getCarrierChildren(void) 141 135 { return new std::list<PickupCarrier*>(); } 142 136 virtual PickupCarrier* getCarrierParent(void) 143 137 { return NULL; } 144 virtual const Vector3& getCarrierPosition(void)145 { return this->getWorldPosition(); };146 138 147 139 float health_;
Note: See TracChangeset
for help on using the changeset viewer.