diff --git a/sources/reactphysics3d/physics/Time.h b/sources/reactphysics3d/physics/Time.h index 5cebd1b8..0debc29f 100644 --- a/sources/reactphysics3d/physics/Time.h +++ b/sources/reactphysics3d/physics/Time.h @@ -50,6 +50,8 @@ class Time { Time operator+(const Time& time2) const; // Overloaded operator for addition 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 + bool operator<(const Time& time2) const; // Overloaded operator for less than comparison + bool operator>(const Time& time2) const; // Overloaded operator for greater than comparison }; // --- Inlines functions --- // @@ -104,6 +106,18 @@ inline Time Time::operator*(double number) const throw(std::invalid_argument) { } } +// Overloaded operator for less than comparison +// TODO : TEST THIS METHOD +inline bool Time::operator<(const Time& time2) const { + return (getValue() < time2.getValue()); +} + +// Overloaded operator for greater than comparison +// TODO : TEST THIS METHOD +inline bool Time::operator>(const Time& time2) const { + return (getValue() > time2.getValue()); +} + } #endif