Exercice 1 fini

Exercice 2 fini

git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@217 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
chappuis.daniel 2009-11-29 10:51:45 +00:00
parent 29bf51a0c4
commit ad0cf1debc

View File

@ -51,6 +51,7 @@ class Time {
Time operator-(const Time& time2) const throw(std::invalid_argument); // Overloaded operator for substraction with Time Time operator-(const Time& time2) const throw(std::invalid_argument); // Overloaded operator for substraction with Time
Time operator*(double number) const throw(std::invalid_argument); // Overloaded operator for multiplication with a number Time operator*(double number) const throw(std::invalid_argument); // Overloaded operator for multiplication with a number
bool operator<(const Time& time2) const; // Overloaded operator for less than comparison bool operator<(const Time& time2) const; // Overloaded operator for less than comparison
bool operator<=(const Time& time2) const; // Overloaded operator for less than or equal comparison
bool operator>(const Time& time2) const; // Overloaded operator for greater than comparison bool operator>(const Time& time2) const; // Overloaded operator for greater than comparison
}; };
@ -112,6 +113,11 @@ inline bool Time::operator<(const Time& time2) const {
return (getValue() < time2.getValue()); return (getValue() < time2.getValue());
} }
// Overloaded operator for less than or equal comparison
inline bool Time::operator<=(const Time& time2) const {
return (getValue() <= time2.getValue());
}
// Overloaded operator for greater than comparison // Overloaded operator for greater than comparison
// TODO : TEST THIS METHOD // TODO : TEST THIS METHOD
inline bool Time::operator>(const Time& time2) const { inline bool Time::operator>(const Time& time2) const {