- Timestamp:
- Dec 30, 2015, 1:59:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/pickup/items/MetaPickup.cc
r10916 r10998 79 79 this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier()); 80 80 81 this->setDurationType( pickupDurationType::once);82 this->metaType_ = pickupMetaType::none;81 this->setDurationType(PickupDurationType::once); 82 this->metaType_ = PickupMetaType::none; 83 83 } 84 84 … … 104 104 105 105 // If the MetaPickup transited to used, and the metaType is not none. 106 if(this->isUsed() && this->metaType_ != pickupMetaType::none)106 if(this->isUsed() && this->metaType_ != PickupMetaType::none) 107 107 { 108 108 PickupCarrier* carrier = this->getCarrier(); 109 if(this->getMetaType() != pickupMetaType::none && carrier != nullptr)109 if(this->getMetaType() != PickupMetaType::none && carrier != nullptr) 110 110 { 111 111 // If the metaType is destroyCarrier, then the PickupCarrier is destroyed. 112 if(this->getMetaType() == pickupMetaType::destroyCarrier)112 if(this->getMetaType() == PickupMetaType::destroyCarrier) 113 113 { 114 114 Pawn* pawn = orxonox_cast<Pawn*>(carrier); … … 124 124 125 125 // If the metaType is use, then the Pickupable is set to used. 126 if(this->getMetaType() == pickupMetaType::use && !pickup->isUsed())126 if(this->getMetaType() == PickupMetaType::use && !pickup->isUsed()) 127 127 { 128 128 pickup->setUsed(true); 129 129 } 130 130 // If the metaType is drop, then the Pickupable is dropped. 131 else if(this->getMetaType() == pickupMetaType::drop)131 else if(this->getMetaType() == PickupMetaType::drop) 132 132 { 133 133 pickup->drop(); 134 134 } 135 135 // If the metaType is destroy, then the Pickupable is destroyed. 136 else if(this->getMetaType() == pickupMetaType::destroy)136 else if(this->getMetaType() == PickupMetaType::destroy) 137 137 { 138 138 pickup->Pickupable::destroy(); … … 154 154 switch(this->getMetaType()) 155 155 { 156 case pickupMetaType::none:156 case PickupMetaType::none: 157 157 return MetaPickup::metaTypeNone_s; 158 case pickupMetaType::use:158 case PickupMetaType::use: 159 159 return MetaPickup::metaTypeUse_s; 160 case pickupMetaType::drop:160 case PickupMetaType::drop: 161 161 return MetaPickup::metaTypeDrop_s; 162 case pickupMetaType::destroy:162 case PickupMetaType::destroy: 163 163 return MetaPickup::metaTypeDestroy_s; 164 case pickupMetaType::destroyCarrier:164 case PickupMetaType::destroyCarrier: 165 165 return MetaPickup::metaTypeDestroyCarrier_s; 166 166 default: … … 179 179 if(type == MetaPickup::metaTypeNone_s) 180 180 { 181 this->setMetaType( pickupMetaType::none);181 this->setMetaType(PickupMetaType::none); 182 182 } 183 183 else if(type == MetaPickup::metaTypeUse_s) 184 184 { 185 this->setMetaType( pickupMetaType::use);185 this->setMetaType(PickupMetaType::use); 186 186 } 187 187 else if(type == MetaPickup::metaTypeDrop_s) 188 188 { 189 this->setMetaType( pickupMetaType::drop);189 this->setMetaType(PickupMetaType::drop); 190 190 } 191 191 else if(type == MetaPickup::metaTypeDestroy_s) 192 192 { 193 this->setMetaType( pickupMetaType::destroy);193 this->setMetaType(PickupMetaType::destroy); 194 194 } 195 195 else if(type == MetaPickup::metaTypeDestroyCarrier_s) 196 196 { 197 this->setMetaType( pickupMetaType::destroyCarrier);197 this->setMetaType(PickupMetaType::destroyCarrier); 198 198 } 199 199 else
Note: See TracChangeset
for help on using the changeset viewer.