R-Type  2
Doom but in better
Loading...
Searching...
No Matches
Rect.hpp File Reference

Defines a rectangle class (Rect) mimicking sf::Rect without relying on SFML. More...

#include <utility>
#include <iostream>
#include <optional>
#include <algorithm>
#include "Log.hpp"
#include "LogMacros.hpp"
Include dependency graph for Rect.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  Recoded::Rect< T >
 A generic 2D rectangle class that holds position and size as pairs. More...
 

Namespaces

namespace  Recoded
 

Typedefs

typedef Rect< int > Recoded::IntRect
 The Rect element cast as an int.
 
typedef Rect< long int > Recoded::LIntRect
 The Rect element cast as a long int.
 
typedef Rect< long long int > Recoded::LLIntRect
 The Rect element cast as a long long int.
 
typedef Rect< unsigned int > Recoded::UIntRect
 The Rect element cast as an unsigned int.
 
typedef Rect< unsigned long int > Recoded::ULIntRect
 The Rect element cast as an unsigned long int.
 
typedef Rect< unsigned long long int > Recoded::ULLIntRect
 The Rect element cast as an unsigned long long int.
 
typedef Rect< float > Recoded::FloatRect
 the Rect element cast as a float
 
typedef Rect< double > Recoded::DoubleRect
 The Rect element cast as a double.
 

Functions

template<typename T >
std::ostream & Recoded::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 << operator.
 
template<typename T >
constexpr bool Recoded::operator== (const Rect< T > &lhs, const Rect< T > &rhs)
 Overload that allows the user to check if 2 rect instances are identical.
 
template<typename T >
constexpr bool Recoded::operator!= (const Rect< T > &lhs, const Rect< T > &rhs)
 Inequality operators for the Rect.
 
template<typename RectType >
const std::string Recoded::myToString (const Rect< RectType > &rectangle)
 Converts a Rect<T> object to its string representation.
 

Detailed Description

Defines a rectangle class (Rect) mimicking sf::Rect without relying on SFML.

This class provides a simple 2D axis-aligned rectangle implementation, which supports operations like checking point containment, finding intersections, and getting the rectangle's center. It can work with different numeric types (int, float, etc.).

Definition in file Rect.hpp.