Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2012, 10:36:24 PM (12 years ago)
Author:
landauf
Message:

removed PickupIdentifier for a number of reasons (I talked to Damian about it before)
a pickup now references the PickupRepresentation by name with the "representation" attribute

Location:
code/branches/presentation2012merge/src/modules/pickup/items
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2012merge/src/modules/pickup/items/DamageBoostPickup.cc

    r9305 r9318  
    3838#include "core/XMLPort.h"
    3939
    40 #include "pickup/PickupIdentifier.h"
    4140#include "worldentities/pawns/SpaceShip.h"
    4241
     
    7877    /**
    7978    @brief
    80         Initializes the PickupIdentifier of this pickup.
    81     */
    82     void DamageBoostPickup::initializeIdentifier(void)
    83     {
    84         this->pickupIdentifier_->addParameter("duration", this->getDuration());
    85         this->pickupIdentifier_->addParameter("damageMultiplier", this->getDamageMultiplier());
    86     }
    87 
    88     /**
    89     @brief
    9079        Method for creating a DamageBoostPickup object through XML.
    9180    */
     
    9685        XMLPortParam(DamageBoostPickup, "duration", setDuration, getDuration, xmlelement, mode);
    9786        XMLPortParam(DamageBoostPickup, "damageMultiplier", setDamageMultiplier, getDamageMultiplier, xmlelement, mode);
    98 
    99         this->initializeIdentifier();
    10087    }
    10188
     
    196183        pickup->setDuration(this->getDuration());
    197184        pickup->setDamageMultiplier(this->getDamageMultiplier());
    198         pickup->initializeIdentifier();
    199185    }
    200186
  • code/branches/presentation2012merge/src/modules/pickup/items/DamageBoostPickup.h

    r9272 r9318  
    7979
    8080        protected:
    81             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    8281            void setDamageMultiplier(float damageMultiplier); //!< Sets the DamageMultiplier according to the XML.
    8382
  • code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.cc

    r9313 r9318  
    3939
    4040#include "controllers/DroneController.h"
    41 #include "pickup/PickupIdentifier.h"
    4241#include "worldentities/Drone.h"
    4342#include "worldentities/pawns/Pawn.h"
     
    8180    /**
    8281    @brief
    83         Initializes the PickupIdentifier of this pickup.
    84     */
    85     void DronePickup::initializeIdentifier(void)
    86     {
    87         this->pickupIdentifier_->addParameter("droneTemplate", this->getDroneTemplate());
    88     }
    89 
    90     /**
    91     @brief
    9282        Method for creating a DronePickup object through XML.
    9383    */
     
    9686        SUPER(DronePickup, XMLPort, xmlelement, mode);
    9787        XMLPortParam(DronePickup, "droneTemplate", setDroneTemplate, getDroneTemplate, xmlelement, mode);
    98 
    99         this->initializeIdentifier();
    10088    }
    10189
     
    198186        DronePickup* pickup = orxonox_cast<DronePickup*>(item);
    199187        pickup->setDroneTemplate(this->getDroneTemplate());
    200 
    201         pickup->initializeIdentifier();
    202188    }
    203189}
  • code/branches/presentation2012merge/src/modules/pickup/items/DronePickup.h

    r9312 r9318  
    7575
    7676        protected:
    77             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    78 
    7977            void setDroneTemplate(const std::string& templatename); //!< Set the droneTemplate.
    8078
  • code/branches/presentation2012merge/src/modules/pickup/items/HealthPickup.cc

    r9312 r9318  
    3838#include "core/XMLPort.h"
    3939
    40 #include "pickup/PickupIdentifier.h"
    4140#include "worldentities/pawns/Pawn.h"
    4241
     
    8786    /**
    8887    @brief
    89         Initializes the PickupIdentifier of this pickup.
    90     */
    91     void HealthPickup::initializeIdentifier(void)
    92     {
    93         this->pickupIdentifier_->addParameter("health", this->getHealth());
    94         this->pickupIdentifier_->addParameter("healthType", this->getHealthType());
    95         this->pickupIdentifier_->addParameter("healthRate", this->getHealthRate());
    96     }
    97 
    98     /**
    99     @brief
    10088        Method for creating a HealthPickup object through XML.
    10189    */
     
    11098        if(!this->isContinuous())
    11199            this->setHealthRate(0.0f); // TODO: this logic should be inside tick(), not in XMLPort
    112 
    113         this->initializeIdentifier();
    114100    }
    115101
     
    277263        pickup->setHealthRate(this->getHealthRate());
    278264        pickup->setHealthType(this->getHealthType());
    279 
    280         pickup->initializeIdentifier();
    281265    }
    282266
  • code/branches/presentation2012merge/src/modules/pickup/items/HealthPickup.h

    r9312 r9318  
    121121
    122122        protected:
    123             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    124 
    125123            void setHealth(float health); //!< Sets the health.
    126124            void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous.
  • code/branches/presentation2012merge/src/modules/pickup/items/InvisiblePickup.cc

    r9305 r9318  
    4040#include "core/XMLPort.h"
    4141
    42 #include "pickup/PickupIdentifier.h"
    4342#include "worldentities/pawns/Pawn.h"
    4443
     
    7978    /**
    8079    @brief
    81         Initializes the PickupIdentifier of this pickup.
    82     */
    83     void InvisiblePickup::initializeIdentifier(void)
    84     {
    85         this->pickupIdentifier_->addParameter("duration", this->getDuration());
    86     }
    87 
    88     /**
    89     @brief
    9080        Method for creating a HealthPickup object through XML.
    9181    */
     
    9484        SUPER(InvisiblePickup, XMLPort, xmlelement, mode);
    9585        XMLPortParam(InvisiblePickup, "duration", setDuration, getDuration, xmlelement, mode);
    96 
    97         this->initializeIdentifier();
    9886    }
    9987
     
    157145        InvisiblePickup* pickup = orxonox_cast<InvisiblePickup*>(item);
    158146        pickup->setDuration(this->getDuration());
    159         pickup->initializeIdentifier();
    160147    }
    161148
  • code/branches/presentation2012merge/src/modules/pickup/items/InvisiblePickup.h

    r7547 r9318  
    7272            InvisiblePickup(BaseObject* creator); //!< Constructor.
    7373            virtual ~InvisiblePickup(); //!< Destructor.
    74            
     74
    7575            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
    7676            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
     
    9191
    9292        protected:
    93             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    94 
    9593            bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again.
    9694            void setDuration(float duration); //!< Sets the time the InvisibilityPickup will last.
  • code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.cc

    r9313 r9318  
    3636
    3737#include "interfaces/PickupCarrier.h"
    38 #include "pickup/PickupIdentifier.h"
    3938#include "worldentities/pawns/Pawn.h"
    4039
     
    8685    /**
    8786    @brief
    88         Helper method to initialize the PickupIdentifier.
    89     */
    90     void MetaPickup::initializeIdentifier(void)
    91     {
    92         this->pickupIdentifier_->addParameter("metaType", this->getMetaType());
    93     }
    94 
    95     /**
    96     @brief
    9787        Method for creating a MetaPickup object through XML.
    9888    */
     
    10292
    10393        XMLPortParam(MetaPickup, "metaType", setMetaTypeAsString, getMetaTypeAsString, xmlelement, mode);
    104 
    105         this->initializeIdentifier();
    10694    }
    10795
     
    172160        MetaPickup* pickup = orxonox_cast<MetaPickup*>(item);
    173161        pickup->setMetaType(this->getMetaType());
    174 
    175         pickup->initializeIdentifier();
    176162    }
    177163
  • code/branches/presentation2012merge/src/modules/pickup/items/MetaPickup.h

    r9312 r9318  
    106106
    107107        protected:
    108             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    109 
    110108            /**
    111109            @brief Set the meta type of the MetaPickup.
  • code/branches/presentation2012merge/src/modules/pickup/items/ShieldPickup.cc

    r9305 r9318  
    3838#include "core/XMLPort.h"
    3939
    40 #include "pickup/PickupIdentifier.h"
    4140#include "worldentities/pawns/Pawn.h"
    4241
     
    8079    /**
    8180    @brief
    82         Initializes the PickupIdentifier of this pickup.
    83     */
    84     void ShieldPickup::initializeIdentifier(void)
    85     {
    86         this->pickupIdentifier_->addParameter("duration", this->getDuration());
    87         this->pickupIdentifier_->addParameter("ShieldHealth", this->getShieldHealth());
    88         this->pickupIdentifier_->addParameter("ShieldAbsorption", this->getShieldAbsorption());
    89     }
    90 
    91     /**
    92     @brief
    9381        Method for creating a ShieldPickup object through XML.
    9482    */
     
    10088        XMLPortParam(ShieldPickup, "shieldabsorption", setShieldAbsorption, getShieldAbsorption, xmlelement, mode);
    10189        XMLPortParam(ShieldPickup, "duration", setDuration, getDuration, xmlelement, mode);
    102 
    103         this->initializeIdentifier();
    10490    }
    10591
     
    188174        pickup->setShieldAbsorption(this->getShieldAbsorption());
    189175        pickup->setShieldHealth(this->getShieldHealth());
    190         pickup->initializeIdentifier();
    191176    }
    192177
  • code/branches/presentation2012merge/src/modules/pickup/items/ShieldPickup.h

    r7547 r9318  
    104104
    105105        protected:
    106             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    107106            void pickupTimerCallback(void); //!< Helper method. Is called by the Timer as soon as it expires.
    108107
  • code/branches/presentation2012merge/src/modules/pickup/items/ShrinkPickup.cc

    r9305 r9318  
    4040#include "core/XMLPort.h"
    4141
    42 #include "pickup/PickupIdentifier.h"
    4342#include "worldentities/pawns/Pawn.h"
    4443
     
    8180    }
    8281
    83     void ShrinkPickup::initializeIdentifier(void)
    84     {
    85         this->pickupIdentifier_->addParameter("shrinkFactor", this->getShrinkFactor());
    86         this->pickupIdentifier_->addParameter("duration", this->getDuration());
    87         this->pickupIdentifier_->addParameter("shrinkDuration", this->getShrinkDuration());
    88     }
    89 
    9082   /**
    9183    @brief
     
    9991        XMLPortParam(ShrinkPickup, "duration", setDuration, getDuration, xmlelement, mode);
    10092        XMLPortParam(ShrinkPickup, "shrinkDuration", setShrinkDuration, getShrinkDuration, xmlelement, mode);
    101 
    102         this->initializeIdentifier();
    10393    }
    10494
     
    321311        pickup->setDuration(this->getDuration());
    322312        pickup->setShrinkDuration(this->getShrinkDuration());
    323 
    324         pickup->initializeIdentifier();
    325313    }
    326314}
  • code/branches/presentation2012merge/src/modules/pickup/items/ShrinkPickup.h

    r8858 r9318  
    119119                { if(speed <= 0.0f) { orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; }
    120120
    121         protected:
    122             void initializeIdentifier(void);
    123 
    124121        private:
    125122            void initialize(void);
     
    135132            float currentFactor_;       //!< The shrink factor that is currently applied.
    136133            float timeRemainig_;        //!< The remaining shrink time.
    137            
     134
    138135            Pawn* carrierToPawnHelper(void);
    139136            Timer durationTimer_;
  • code/branches/presentation2012merge/src/modules/pickup/items/SpeedPickup.cc

    r9305 r9318  
    3838#include "core/XMLPort.h"
    3939
    40 #include "pickup/PickupIdentifier.h"
    4140#include "worldentities/pawns/SpaceShip.h"
    4241
     
    8079    /**
    8180    @brief
    82         Initializes the PickupIdentifier of this pickup.
    83     */
    84     void SpeedPickup::initializeIdentifier(void)
    85     {
    86         this->pickupIdentifier_->addParameter("duration", this->getDuration());
    87         this->pickupIdentifier_->addParameter("speedAdd", this->getSpeedAdd());
    88         this->pickupIdentifier_->addParameter("speedMultiply", this->getSpeedMultiply());
    89     }
    90 
    91     /**
    92     @brief
    9381        Method for creating a SpeedPickup object through XML.
    9482    */
     
    10088        XMLPortParam(SpeedPickup, "speedAdd", setSpeedAdd, getSpeedAdd, xmlelement, mode);
    10189        XMLPortParam(SpeedPickup, "speedMultiply", setSpeedMultiply, getSpeedMultiply, xmlelement, mode);
    102 
    103         this->initializeIdentifier();
    10490    }
    10591
     
    189175        pickup->setSpeedAdd(this->getSpeedAdd());
    190176        pickup->setSpeedMultiply(this->getSpeedMultiply());
    191 
    192         pickup->initializeIdentifier();
    193177    }
    194178
  • code/branches/presentation2012merge/src/modules/pickup/items/SpeedPickup.h

    r9269 r9318  
    103103
    104104        protected:
    105             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
    106105            void pickupTimerCallback(void); //!< Function that gets called when timer ends.
    107106
Note: See TracChangeset for help on using the changeset viewer.