- Timestamp:
- Mar 13, 2010, 3:32:34 PM (15 years ago)
- Location:
- code/branches/pickup3
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup3/data/levels/includes/pickups.oxi
r6498 r6519 38 38 </pickup> 39 39 </PickupRepresentation> 40 41 <PickupRepresentation 42 name = "Double Pickup" 43 description = "Does stuff." 44 spawnerTemplate = "crazyhealthpickupRepresentation" 45 > 46 <pickup> 47 <PickupCollection template=doublepickup /> 48 </pickup> 49 </PickupRepresentation> -
code/branches/pickup3/data/levels/pickup.oxw
r6518 r6519 37 37 <PickupSpawner position="-50,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10"> 38 38 <pickup> 39 <HealthPickup health=50 healthRate=5 durationType=continuous activationType=onUse healthType= limited/>39 <HealthPickup health=50 healthRate=5 durationType=continuous activationType=onUse healthType=permanent /> 40 40 </pickup> 41 41 </PickupSpawner> … … 64 64 </pickup> 65 65 </PickupSpawner> 66 67 <PickupSpawner position="75,0,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10"> 68 <pickup> 69 <PickupCollection template=doublepickup /> 70 </pickup> 71 </PickupSpawner> 66 72 67 73 <!--PickupSpawner position="100,100,100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10"> -
code/branches/pickup3/data/levels/templates/pickup_representation_templates.oxt
r6512 r6519 98 98 /> 99 99 </Template> 100 101 <Template name=doublepickup> 102 <PickupCollection> 103 <pickupables> 104 <HealthPickup template=smallhealthpickup /> 105 <HealthPickup health=50 healthRate=5 durationType=continuous activationType=immediate healthType=limited /> 106 </pickupables> 107 </PickupCollection> 108 </Template> 109 -
code/branches/pickup3/src/modules/pickup/PickupCollection.cc
r6497 r6519 45 45 { 46 46 47 CreateFactory(PickupCollection); 48 47 49 /** 48 50 @brief … … 77 79 SUPER(PickupCollection, XMLPort, xmlelement, mode); 78 80 79 //TODO: Does this work? Problem could be, that Pickupable itself cannot be instantiated through XML, doubt that, though. 80 XMLPortObject(PickupCollection, PickupCollection, "pickupables", addPickupable, getPickupable, xmlelement, mode); 81 XMLPortObject(PickupCollection, Pickupable, "pickupables", addPickupable, getPickupable, xmlelement, mode); 81 82 82 83 this->initializeIdentifier(); … … 103 104 bool PickupCollection::createSpawner(const Vector3& position) 104 105 { 105 DroppedPickup::DroppedPickup(this, this, position);106 new DroppedPickup(this, this, position); 106 107 return true; 107 108 } … … 178 179 } 179 180 181 bool PickupCollection::isTarget(Identifier* identifier) const 182 { 183 for(std::vector<Pickupable*>::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) 184 { 185 if(!(*it)->isTarget(identifier)) 186 return false; 187 } 188 189 return true; 190 } 191 180 192 const PickupIdentifier* PickupCollection::getPickupIdentifier(void) 181 193 { -
code/branches/pickup3/src/modules/pickup/PickupCollection.h
r6497 r6519 47 47 Damian 'Mozork' Frick 48 48 */ 49 //TODO: Isn't private inheritance sufficient?50 49 class _PickupExport PickupCollection : public Pickupable, public BaseObject 51 50 { … … 63 62 64 63 virtual void clone(OrxonoxClass*& item); 64 65 virtual bool isTarget(Identifier* identifier) const; 65 66 66 67 virtual const PickupIdentifier* getPickupIdentifier(void); -
code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc
r6480 r6519 50 50 if(collectionIdentifier == NULL) 51 51 { 52 return this-> compare(identifier);52 return this->PickupIdentifier::compare(identifier); 53 53 } 54 54 -
code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h
r6480 r6519 38 38 { 39 39 40 class PickupCollectionIdentifier : public PickupIdentifier40 class _PickupExport PickupCollectionIdentifier : public PickupIdentifier 41 41 { 42 42 -
code/branches/pickup3/src/modules/pickup/items/MetaPickup.cc
r6518 r6519 27 27 */ 28 28 29 /** 30 @file 31 @brief Implementation of the MetaPickup class. 32 */ 33 29 34 #include "core/CoreIncludes.h" 30 35 #include "core/XMLPort.h" … … 42 47 /*static*/ const std::string MetaPickup::metaTypeDrop_s = "drop"; 43 48 49 /** 50 @brief 51 Constructor. 52 */ 44 53 MetaPickup::MetaPickup(BaseObject* creator) : Pickup(creator) 45 54 { -
code/branches/pickup3/src/modules/pickup/items/MetaPickup.h
r6518 r6519 27 27 */ 28 28 29 /** 30 @file 31 @brief Definition of the MetaPickup class. 32 */ 33 29 34 #ifndef _MetaPickup_H__ 30 35 #define _MetaPickup_H__ … … 36 41 namespace orxonox { 37 42 43 //! The meta type, deciding what the pickup does exactly. 38 44 namespace pickupMetaType 39 45 { … … 46 52 } 47 53 54 /** 55 @brief 56 The MetaPickup is a pickup that can, depending on the parameters, either drop all pickups of the PickupCarrier that picks it up, or use all the unused pickups of the PickupCarrier, that picks it up. The parameter to set for this is the metaType and it can be used with the values 'none', 'drop' and 'use'. 57 @author 58 Damian 'Mozork' Frick 59 */ 48 60 class _PickupExport MetaPickup : public Pickup 49 61 { 50 friend class PickupCarrier;51 62 52 63 public: -
code/branches/pickup3/src/orxonox/interfaces/Pickupable.h
r6497 r6519 83 83 84 84 bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup. 85 bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this pickup.85 virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this pickup. 86 86 bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup. 87 87 bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this pickup.
Note: See TracChangeset
for help on using the changeset viewer.