Changeset 7504 for code/trunk/src/orxonox/interfaces
- Timestamp:
- Oct 6, 2010, 8:00:40 AM (14 years ago)
- Location:
- code/trunk/src/orxonox/interfaces
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/interfaces/CMakeLists.txt
r7494 r7504 3 3 Pickupable.cc 4 4 PickupCarrier.cc 5 PickupListener.cc 5 6 RadarViewable.cc 6 7 ) -
code/trunk/src/orxonox/interfaces/Pickupable.cc
r7494 r7504 34 34 #include "Pickupable.h" 35 35 36 #include "core/LuaState.h"37 #include "core/GUIManager.h"38 36 #include "core/Identifier.h" 39 37 #include "core/CoreIncludes.h" … … 45 43 46 44 #include "PickupCarrier.h" 45 #include "PickupListener.h" 47 46 48 47 namespace orxonox … … 130 129 131 130 this->used_ = used; 131 132 // Notify all the PickupListeners of the change. 133 PickupListener::broadcastPickupChangedUsed(this, used); 134 132 135 this->changedUsed(); 133 136 134 //TODO: Synchronize & make safe for dedicated server. 135 GUIManager::getInstance().getLuaState()->doString("PickupInventory.update()"); 137 136 138 return true; 137 139 } … … 222 224 return false; 223 225 } 224 226 225 227 this->setPickedUp(true); 226 228 COUT(4) << "Pickupable (&" << this << ") got picked up by a PickupCarrier (&" << carrier << ")." << std::endl; … … 277 279 278 280 this->pickedUp_ = pickedUp; 281 282 // Notify all the PickupListeners of the change. 283 PickupListener::broadcastPickupChangedPickedUp(this, pickedUp); 284 279 285 if(!pickedUp) // if the Pickupable has been dropped it unregisters itself with its PickupCarrier. 280 286 this->getCarrier()->removePickup(this); 281 287 this->changedPickedUp(); 282 288 283 //TODO: Synchronize & make safe for dedicated server.284 GUIManager::getInstance().getLuaState()->doString("PickupInventory.update()");285 289 return true; 286 290 } -
code/trunk/src/orxonox/interfaces/Pickupable.h
r7494 r7504 44 44 #include "Rewardable.h" 45 45 46 namespace orxonox // tolua_export47 { // tolua_export46 namespace orxonox 47 { 48 48 49 49 /** … … 58 58 Damian 'Mozork' Frick 59 59 */ 60 class _OrxonoxExport Pickupable // tolua_export 61 : virtual public OrxonoxClass, public Rewardable 62 { // tolua_export 60 class _OrxonoxExport Pickupable : virtual public OrxonoxClass, public Rewardable 61 { 63 62 protected: 64 63 Pickupable(); //!< Default constructor. … … 71 70 @return Returns true if the Pickupable is currently in use. 72 71 */ 73 inline bool isUsed(void) { return this->used_; } // tolua_export 72 inline bool isUsed(void) 73 { return this->used_; } 74 74 /** 75 75 @brief Should be called when the Pickupable has transited from used to unused or the other way around. … … 94 94 @return Returns true if the Pickupable is currently picked up, false if not. 95 95 */ 96 inline bool isPickedUp(void) { return this->pickedUp_; } // tolua_export 96 inline bool isPickedUp(void) 97 { return this->pickedUp_; } 97 98 /** 98 99 @brief Should be called when the Pickupable has transited from picked up to dropped or the other way around. … … 105 106 @return Returns true if it can be used. 106 107 */ 107 inline bool isUsable(void) { return this->enabled_; } // tolua_export 108 108 inline bool isUsable(void) 109 { return this->enabled_; } 110 109 111 /** 110 112 @brief Returns whether the Pickupable can be unused. 111 113 @return Returns true if it can be unused. 112 114 */ 113 inline bool isUnusable(void) { return this->enabled_; } // tolua_export 115 inline bool isUnusable(void) 116 { return this->enabled_; } 114 117 115 118 /** … … 190 193 virtual bool reward(PlayerInfo* player); //!< Method to transcribe a Pickupable as a Rewardable to the player. 191 194 192 }; // tolua_export195 }; 193 196 194 197 //! SUPER functions. … … 196 199 SUPER_FUNCTION(12, Pickupable, changedCarrier, false); 197 200 SUPER_FUNCTION(13, Pickupable, changedPickedUp, false); 198 } // tolua_export201 } 199 202 200 203 #endif /* _Pickupable_H__ */
Note: See TracChangeset
for help on using the changeset viewer.