64 constexpr explicit operator Rect<U>()
const;
75 constexpr bool contains(std::pair<T, T> point)
const;
111 template <
typename T>
132 template <
typename T>
133 constexpr bool operator==(
const Rect<T> &lhs,
const Rect<T> &rhs);
146 template <
typename T>
147 constexpr bool operator!=(
const Rect<T> &lhs,
const Rect<T> &rhs);
222 template <
typename RectType>
Macro definitions for logging messages with varying levels of detail and formatting.
This is the file in charge of containing the Log class (the one in charge of outputing info only when...
A generic 2D rectangle class that holds position and size as pairs.
std::pair< T, T > size
The size of the rectangle (width, height)
Rect()
Default constructor, initializes the rectangle with default values (0, 0) for position and size.
std::optional< Rect< T > > findIntersection(const Rect< T > &rect) const
Finds the intersection between this rectangle and another.
constexpr bool contains(std::pair< T, T > point) const
Checks if a point is inside the rectangle (non-inclusive).
std::pair< T, T > getCenter() const
Gets the center of the rectangle.
std::pair< T, T > position
the position (top and left corner)
Rect< unsigned long long int > ULLIntRect
The Rect element cast as an unsigned long long int.
Rect< double > DoubleRect
The Rect element cast as a double.
Rect< long int > LIntRect
The Rect element cast as a long int.
constexpr bool operator!=(const Rect< T > &lhs, const Rect< T > &rhs)
Inequality operators for the Rect.
Rect< unsigned int > UIntRect
The Rect element cast as an unsigned int.
Rect< unsigned long int > ULIntRect
The Rect element cast as an unsigned long int.
Rect< int > IntRect
The Rect element cast as an int.
Rect< long long int > LLIntRect
The Rect element cast as a long long int.
Rect< float > FloatRect
the Rect element cast as a float
std::ostream & operator<<(std::ostream &os, const Rect< T > &rectangle)
Operator in charge of outputing the values contained in the _rect when it is passed through a << oper...
const std::string myToString(const Rect< RectType > &rectangle)
Converts a Rect<T> object to its string representation.
constexpr bool operator==(const Rect< T > &lhs, const Rect< T > &rhs)
Overload that allows the user to check if 2 rect instances are identical.