/** evolveTowards allows the competency to increase or decrease according to the value passed in parameter (either in Magnitude._value or double). It represents the competency evolving towards a specfic state, here represented by this->_m.value() + m.value().
* Use it instead of manipuling directly a Magnitude, since it'll handle MagnitudeException
*
* @throw CompetencyEvolvingException
*/
voidevolveTowards(Magnitude&m);
/** evolveTowards allows the competency to increase or decrease according to the value passed in parameter (either in Magnitude._value or double). It represents the competency evolving towards a specfic state, here represented by this->_m.value() + d.
* Use it instead of manipuling directly a Magnitude, since it'll handle MagnitudeException
*
* @throw CompetencyEvolvingException
*/
voidevolveTowards(doubled);
// === GETTER
///Retrieves the magnitude/mastery value of the competency
@@ -33,6 +33,9 @@ Magnitude::Magnitude(const Magnitude & m)
...
@@ -33,6 +33,9 @@ Magnitude::Magnitude(const Magnitude & m)
// === OPERATOR
// === OPERATOR
/**
* @throw MagnitudeException Throw a MagnitudeException if the new value is > 1 or < 0. Note that the this->_value IS set (thus you can use this->rebase() to put _value in good range)
* @throw MagnitudeException Throw a MagnitudeException if the new value is > 1 or < 0. Note that the this->_value IS set (thus you can use this->rebase() to put _value in good range)
*/
Magnitude&Magnitude::operator+=(constMagnitude&m)
Magnitude&Magnitude::operator+=(constMagnitude&m)
{
{
this->_value+=m._value;
this->_value+=m._value;
...
@@ -49,6 +55,9 @@ Magnitude & Magnitude::operator+=(const Magnitude & m)
...
@@ -49,6 +55,9 @@ Magnitude & Magnitude::operator+=(const Magnitude & m)
return*this;
return*this;
}
}
/**
* @throw MagnitudeException Throw a MagnitudeException if the new value is > 1 or < 0. You can catch the new magnitude causing the exception with magnitudeException.getMagnitude() (and thus perform the desired action, like a rebase)
* @throw MagnitudeException Throw a MagnitudeException if the new value is > 1 or < 0. You can catch the new magnitude causing the exception with magnitudeException.getMagnitude() (and thus perform the desired action, like a rebase)