Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 3, 2016, 5:48:18 PM (8 years ago)
Author:
fvultier
Message:

Implemented a feature that was requested during PPS: Vulnerability can be switched on/off using the event system. Also: Resolved a TODO in CommandNotification.cc .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/fabienHS15/src/orxonox/worldentities/pawns/Pawn.h

    r10814 r11027  
    6262
    6363            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     64            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    6465            virtual void tick(float dt);
    6566
     
    131132
    132133            virtual void decreaseShieldRechargeCountdownTime(float dt);
     134
     135            /** @brief Sets the state of the pawns vulnerability. @param bVulnerable */
     136            inline void setVulnerable(bool bVulnerable)
     137            {
     138                if (this->bVulnerable_ != bVulnerable)
     139                {
     140                    this->bVulnerable_ = bVulnerable;
     141                    this->changedVulnerability();
     142                }
     143            }
     144            /** @brief Returns the state of the pawns vulnerability. @return The state of the vulnerability */
     145            inline const bool& isVulnerable() const { return this->bVulnerable_; }
     146            /** @brief This function gets called if the vulnerability of the pawn changes. */
     147            virtual void changedVulnerability();
    133148
    134149            inline ControllableEntity* getLastHitOriginator() const
     
    212227
    213228            bool bAlive_;
     229            bool bVulnerable_; ///< If false the pawn may not ged damaged
    214230
    215231            virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const
Note: See TracChangeset for help on using the changeset viewer.