Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 21, 2012, 6:16:19 PM (12 years ago)
Author:
landauf
Message:

detail: moved functions from .h to .cc

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

Legend:

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

    r9320 r9321  
    9191        XMLPortParam(ShrinkPickup, "duration", setDuration, getDuration, xmlelement, mode);
    9292        XMLPortParam(ShrinkPickup, "shrinkDuration", setShrinkDuration, getShrinkDuration, xmlelement, mode);
     93    }
     94
     95    /**
     96    @brief Sets the shrinking factor.
     97    @param factor The factor, needs to greater than 1.
     98    */
     99    void ShrinkPickup::setShrinkFactor(float factor)
     100    {
     101        if(factor <= 1.0f)
     102        {
     103            orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl;
     104            return;
     105        }
     106        this->shrinkFactor_ = factor;
     107    }
     108
     109    /**
     110    @brief Set the duration for which the ship remains shrunken.
     111    @param duration The duration, needs to be non-negative.
     112    */
     113    void ShrinkPickup::setDuration(float duration)
     114    {
     115        if(duration < 0.0f)
     116        {
     117            orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl;
     118            return;
     119        }
     120        this->duration_ = duration;
     121    }
     122
     123    /**
     124    @brief Set the shrink duration.
     125    @param speed The shrink duration, needs to be positive.
     126    */
     127    void ShrinkPickup::setShrinkDuration(float speed)
     128    {
     129        if(speed <= 0.0f)
     130        {
     131            orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl;
     132            return;
     133        }
     134        this->shrinkDuration_ = speed;
    93135    }
    94136
  • code/branches/presentation2012merge/src/modules/pickup/items/ShrinkPickup.h

    r9320 r9321  
    8787            inline float getShrinkFactor(void) const
    8888                { return this->shrinkFactor_; }
    89             /**
    90             @brief Sets the shrinking factor.
    91             @param factor The factor, needs to greater than 1.
    92             */
    93             inline void setShrinkFactor(float factor)
    94                 { if(factor <= 1.0f) { orxout(internal_warning, context::pickups) << "Invalid shrinking factor in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkFactor_ = factor; }
     89            void setShrinkFactor(float factor);
     90
    9591            /**
    9692            @brief Get the duration for which the ship remains shrunken.
     
    9995            inline float getDuration(void) const
    10096                { return this->duration_; }
    101             /**
    102             @brief Set the duration for which the ship remains shrunken.
    103             @param duration The duration, needs to be non-negative.
    104             */
    105             inline void setDuration(float duration)
    106                 { if(duration < 0.0f) { orxout(internal_warning, context::pickups) << "Invalid duration in ShrinkPickup. Ignoring.." << endl; return; } this->duration_ = duration; }
     97            void setDuration(float duration);
     98
    10799            /**
    108100            @brief Get the shrink speed.
     
    111103            inline float getShrinkDuration(void) const
    112104                { return this->shrinkDuration_; }
    113             /**
    114             @brief Set the shrink duration.
    115             @param speed The shrink duration, needs to be positive.
    116             */
    117             inline void setShrinkDuration(float speed)
    118                 { if(speed <= 0.0f) { orxout(internal_warning, context::pickups) << "Invalid shrink duration in ShrinkPickup. Ignoring.." << endl; return; } this->shrinkDuration_ = speed; }
     105            void setShrinkDuration(float speed);
    119106
    120107        private:
Note: See TracChangeset for help on using the changeset viewer.