Changeset 6484 for code/branches
- Timestamp:
- Mar 7, 2010, 11:00:05 PM (15 years ago)
- Location:
- code/branches/pickup3/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3/src/modules/pickup/PickupManager.cc
r6475 r6484 52 52 PickupManager::PickupManager() 53 53 { 54 this->defaultRepresentation_ = NULL; 55 this->pickupCarrierStructure_ = NULL; 54 56 RegisterRootObject(PickupManager); 55 57 … … 85 87 bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation) 86 88 { 87 if(this->representations_.find(identifier) == this->representations_.end()) //!< If the Pickupable already has a RepresentationRegistered.89 if(this->representations_.find(identifier) != this->representations_.end()) //!< If the Pickupable already has a RepresentationRegistered. 88 90 return false; 89 91 -
code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc
r6478 r6484 103 103 104 104 PickupManager::getInstance().registerRepresentation(this->pickup_->getPickupIdentifier(), this); //!< Registers the PickupRepresentation with the PickupManager through the PickupIdentifier of the Pickupable it represents. 105 106 if(this->spawnerRepresentation_ != NULL) 107 this->spawnerRepresentation_->setVisible(false); 108 109 COUT(4) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << std::endl; 105 110 } 106 111 … … 128 133 129 134 StaticEntity* representation = this->spawnerRepresentation_; 135 representation->setVisible(true); 130 136 131 137 this->addTemplate(this->spawnerTemplate_); 138 this->spawnerRepresentation_->setVisible(false); 132 139 133 140 return representation; -
code/branches/pickup3/src/modules/pickup/PickupSpawner.cc
r6478 r6484 147 147 { 148 148 PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier()); 149 representation->setVisible(this->isActive()); 149 150 this->attach(representation->getSpawnerRepresentation(this)); 151 this->setActive(true); 150 152 } 151 153 } … … 273 275 void PickupSpawner::trigger(Pawn* pawn) 274 276 { 275 if (this->isActive()) //!< Checks whether PickupItem is active. 276 { 277 COUT(1) << "PickupSpawner triggered." << std::endl; 278 if (this->isActive()) //!< Checks whether PickupSpawner is active. 279 { 280 COUT(1) << "PickupSpawner triggered and active." << std::endl; 281 277 282 PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn); 278 283 if(carrier == NULL) -
code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc
r6480 r6484 120 120 if(!this->isContinuous()) 121 121 this->healthRate_ = 0.0; 122 123 COUT(1) << "HealthPickup " << this->getHealth() << ", " << this->getHealthRate() << ", " << this->getHealthType() << "." << std::endl;124 122 125 123 this->initializeIdentifier(); -
code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc
r6480 r6484 101 101 bool PickupIdentifier::addParameter(std::string & name, std::string & value) 102 102 { 103 COUT( 1) << "PickupIdentifier " << name << ", " << value << std::endl;103 COUT(4) << "PickupIdentifier " << name << ", " << value << std::endl; 104 104 105 105 if(!(this->parameters_.find(name) == this->parameters_.end()))
Note: See TracChangeset
for help on using the changeset viewer.