Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6731 for code/trunk


Ignore:
Timestamp:
Apr 15, 2010, 2:47:39 PM (15 years ago)
Author:
dafrick
Message:

PickupCollection is broken for now because to make it work drastic changes would have to be made. I wil fix it at a later date, though.

Location:
code/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/levels/pickup.oxw

    r6728 r6731  
    114114    <!-- Pickup Collection pickups -->
    115115   
    116     <PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
     116    <!--PickupSpawner position="0,-25,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
    117117        <pickup>
    118118            <PickupCollection template=triplehealthspeedinvisibilitypickup />
    119119        </pickup>
    120     </PickupSpawner>
    121    
    122     <PickupSpawner position="0,-50,-100" triggerDistance="10" respawnTime="30" maxSpawnedItems="10">
    123         <pickup>
    124             <HealthPickup activationType=immediate durationType=continuous healthRate=10 health=100 />
    125         </pickup>
    126     </PickupSpawner>
     120    </PickupSpawner-->
    127121   
    128122  </Scene>
  • code/trunk/src/modules/pickup/PickupCollection.cc

    r6540 r6731  
    176176        Returns true if the PickupCarrier identified by the input PickupIdentififer it is a target of this PickupCollection, false if not.
    177177    */
    178     bool PickupCollection::isTarget(Identifier* identifier) const
     178    bool PickupCollection::isTarget(PickupCarrier* carrier) const
    179179    {
    180180        for(std::vector<WeakPtr<Pickupable> >::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
    181181        {
    182             if(!(*it).get()->isTarget(identifier))
     182            if(!carrier->isTarget((*it).get()))
    183183                return false;
    184184        }
  • code/trunk/src/modules/pickup/PickupCollection.h

    r6540 r6731  
    6767            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
    6868           
    69             virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
     69            virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
    7070           
    7171            virtual const PickupIdentifier* getPickupIdentifier(void); //!< Get the PickupIdentifier of this PickupCollection.
  • code/trunk/src/orxonox/interfaces/Pickupable.cc

    r6725 r6731  
    104104    bool Pickupable::isTarget(const PickupCarrier* carrier) const
    105105    {
     106        if(carrier == NULL)
     107            return false;
    106108        return this->isTarget(carrier->getIdentifier());
    107109    }
     
    109111    /**
    110112    @brief
    111         Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
    112     @param target
    113         The Identifier of which it has to be determinde whether it is a target of this Pickupable.
    114     @return
    115         Returns true if the given Identifier is a target.
    116     */
    117     bool Pickupable::isTarget(Identifier* target) const
     113        Get whether the given Identififer is a target of this Pickupable.
     114    @param identifier
     115        The PickupCarrier of which it has to be determinde whether it is a target of this Pickupable.
     116    @return
     117        Returns true if the given PickupCarrier is a target.
     118    */
     119    bool Pickupable::isTarget(const Identifier* identifier) const
    118120    {
    119121        //! Iterate through all targets of this Pickupable.
    120122        for(std::list<Identifier*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++)
    121123        {
    122             if(target->isA(*it))
     124            if(identifier->isA(*it))
    123125                return true;
    124126        }
  • code/trunk/src/orxonox/interfaces/Pickupable.h

    r6540 r6731  
    9898            bool dropped(void); //!< Sets the Pickupable to not picked up or dropped.
    9999           
    100             bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
    101             virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
     100            virtual bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
     101            bool isTarget(const Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
    102102            bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
    103103            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.