R-Type  2
Doom but in better
Loading...
Searching...
No Matches
Recoded Namespace Reference

Data Structures

class  Rect
 A generic 2D rectangle class that holds position and size as pairs. More...
 

Typedefs

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

Functions

template<typename T >
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 << operator.
 
template<typename T >
constexpr bool 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 operator!= (const Rect< T > &lhs, const Rect< T > &rhs)
 Inequality operators for the Rect.
 
template<typename RectType >
const std::string myToString (const Rect< RectType > &rectangle)
 Converts a Rect<T> object to its string representation.
 
const std::string myToString (bool value)
 Converts a boolean value to its string representation.
 
template<typename T >
const std::string myToString (const T &value)
 Converts a numeric value to its string representation.
 
template<typename T1 , typename T2 >
const std::string myToString (const std::pair< T1, T2 > &value)
 Converts a std::pair to its string representation.
 
template<typename Key , typename Value >
std::string myToString (const std::map< Key, Value > &map)
 Converts a std::map to a string representation.
 
template<typename T >
std::string myToString (const std::set< T > &set)
 Converts a std::set to a string representation.
 
template<typename T >
const std::string myToString (const std::vector< T > &set)
 Converts a std::vector to a string representation.
 
template<typename Key , typename Value >
std::string myToString (const std::unordered_map< Key, Value > &map)
 Converts a std::unordered_map to a string representation.
 
template<typename T >
const std::string myToString (const std::unordered_set< T > &set)
 Converts a std::unordered_set to a string representation.
 
const std::string myToString (const ActiveScreen &item)
 Converts an ActiveScreen enumeration value to a string.
 
const std::string myToString (const GUI::ECS::GameComponents::Package &item)
 Converts a GUI::ECS::GameComponents::Package structure to a string.
 
const std::string myToString (const GUI::ECS::GameComponents::EntityType &item)
 Converts a GUI::ECS::GameComponents::EntityType enumeration value to a string.
 
const std::string myToString (const GUI::ECS::GameComponents::ECSPackage &item)
 Converts a GUI::ECS::GameComponents::ECSPackage structure to a string.
 
const std::string myToString (const GUI::ECS::GameComponents::EntityActions &item)
 Converts a GUI::ECS::GameComponents::EntityActions structure to a string.
 
const std::string myToString (const GUI::ECS::GameComponents::EntityActionType &item)
 Converts a GUI::ECS::GameComponents::EntityActionType enumeration value to a string.
 
const std::string myToString (const GUI::ECS::Systems::ActiveShape &shape)
 Overload for the Active Shape enum so that the user can just output the type of the shape they want.
 
const std::string myToString (const GUI::Network::MessageType &messageType)
 Overload for the Message Type enum so that the user can just output the type of the message that was received.
 
const std::string myToString (const GUI::Network::MessageInfo &messageInfo)
 Overload for the Message Type enum so that the user can just output the type of the message that was received.
 
const std::string myToString (const GUI::Network::MessageNode &messageNode)
 Overload for the Message Type enum so that the user can just output the type of the message that was received.
 

Typedef Documentation

◆ DoubleRect

typedef Rect<double> Recoded::DoubleRect

The Rect element cast as a double.

Definition at line 195 of file Rect.hpp.

◆ FloatRect

typedef Rect<float> Recoded::FloatRect

the Rect element cast as a float

Definition at line 189 of file Rect.hpp.

◆ IntRect

typedef Rect<int> Recoded::IntRect

The Rect element cast as an int.

Definition at line 153 of file Rect.hpp.

◆ LIntRect

typedef Rect<long int> Recoded::LIntRect

The Rect element cast as a long int.

Definition at line 159 of file Rect.hpp.

◆ LLIntRect

typedef Rect<long long int> Recoded::LLIntRect

The Rect element cast as a long long int.

Definition at line 165 of file Rect.hpp.

◆ UIntRect

typedef Rect<unsigned int> Recoded::UIntRect

The Rect element cast as an unsigned int.

Definition at line 171 of file Rect.hpp.

◆ ULIntRect

typedef Rect<unsigned long int> Recoded::ULIntRect

The Rect element cast as an unsigned long int.

Definition at line 177 of file Rect.hpp.

◆ ULLIntRect

typedef Rect<unsigned long long int> Recoded::ULLIntRect

The Rect element cast as an unsigned long long int.

Definition at line 183 of file Rect.hpp.

Function Documentation

◆ myToString() [1/19]

const std::string Recoded::myToString ( bool value)

Converts a boolean value to its string representation.

Unlike std::to_string, which converts true to "1" and false to "0", this function returns "true" for true and "false" for false.

Parameters
valueThe boolean value to convert.
Returns
A string representation of the boolean ("true" or "false").
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 16 of file ToString.cpp.

◆ myToString() [2/19]

const std::string Recoded::myToString ( const ActiveScreen & item)

Converts an ActiveScreen enumeration value to a string.

This function maps each value of the ActiveScreen enum to a corresponding string representation.

Parameters
itemThe ActiveScreen enum value to convert.
Returns
A string representation of the given ActiveScreen enum value.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 24 of file ToString.cpp.

◆ myToString() [3/19]

const std::string Recoded::myToString ( const GUI::ECS::GameComponents::ECSPackage & item)

Converts a GUI::ECS::GameComponents::ECSPackage structure to a string.

Converts a GUI::ECS::GameComponents::ECSPackage_t structure to a string.

This function generates a formatted string representing the details of the ECSPackage structure.

Parameters
itemThe ECSPackage structure to convert.
Returns
A string containing the details of the given ECSPackage.
Note
Uses Recoded::myToString to convert elements to strings.

This function generates a formatted string representing the details of the ECSPackage_t structure.

Parameters
itemThe ECSPackage_t structure to convert.
Returns
A string containing the details of the given ECSPackage_t.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 105 of file ToString.cpp.

◆ myToString() [4/19]

const std::string Recoded::myToString ( const GUI::ECS::GameComponents::EntityActions & item)

Converts a GUI::ECS::GameComponents::EntityActions structure to a string.

Converts a GUI::ECS::GameComponents::EntityActions_t structure to a string.

This function generates a formatted string representing the details of the EntityActions structure.

Parameters
itemThe EntityActions structure to convert.
Returns
A string containing the details of the given EntityActions.
Note
Uses Recoded::myToString to convert elements to strings.

This function generates a formatted string representing the details of the EntityActions_t structure.

Parameters
itemThe EntityActions_t structure to convert.
Returns
A string containing the details of the given EntityActions_t.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 116 of file ToString.cpp.

◆ myToString() [5/19]

const std::string Recoded::myToString ( const GUI::ECS::GameComponents::EntityActionType & item)

Converts a GUI::ECS::GameComponents::EntityActionType enumeration value to a string.

This function maps each value of the EntityActionType enum to a corresponding string representation.

Parameters
itemThe EntityActionType enum value to convert.
Returns
A string representation of the given EntityActionType enum value.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 127 of file ToString.cpp.

◆ myToString() [6/19]

const std::string Recoded::myToString ( const GUI::ECS::GameComponents::EntityType & item)

Converts a GUI::ECS::GameComponents::EntityType enumeration value to a string.

This function maps each value of the EntityType enum to a corresponding string representation.

Parameters
itemThe EntityType enum value to convert.
Returns
A string representation of the given EntityType enum value.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 87 of file ToString.cpp.

◆ myToString() [7/19]

const std::string Recoded::myToString ( const GUI::ECS::GameComponents::Package & item)

Converts a GUI::ECS::GameComponents::Package structure to a string.

Converts a GUI::ECS::GameComponents::Package_t structure to a string.

This function generates a formatted string representing the details of the Package structure.

Parameters
itemThe Package structure to convert.
Returns
A string containing the details of the given Package.
Note
Uses Recoded::myToString to convert elements to strings.

This function generates a formatted string representing the details of the Package_t structure.

Parameters
itemThe Package_t structure to convert.
Returns
A string containing the details of the given Package_t.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 75 of file ToString.cpp.

◆ myToString() [8/19]

const std::string Recoded::myToString ( const GUI::ECS::Systems::ActiveShape & shape)

Overload for the Active Shape enum so that the user can just output the type of the shape they want.

Parameters
shapeGUI::ECS::Systems::ActiveShape
Returns
const std::string

Definition at line 138 of file ToString.cpp.

◆ myToString() [9/19]

const std::string Recoded::myToString ( const GUI::Network::MessageInfo & messageInfo)

Overload for the Message Type enum so that the user can just output the type of the message that was received.

Parameters
shapeGUI::Network::MessageInfo
Returns
const std::string

Definition at line 187 of file ToString.cpp.

◆ myToString() [10/19]

const std::string Recoded::myToString ( const GUI::Network::MessageNode & messageNode)

Overload for the Message Type enum so that the user can just output the type of the message that was received.

Parameters
shapeGUI::Network::MessageNode
Returns
const std::string

Definition at line 200 of file ToString.cpp.

◆ myToString() [11/19]

const std::string Recoded::myToString ( const GUI::Network::MessageType & messageType)

Overload for the Message Type enum so that the user can just output the type of the message that was received.

Parameters
shapeGUI::Network::MessageType
Returns
const std::string

Definition at line 155 of file ToString.cpp.

◆ myToString() [12/19]

template<typename RectType >
const std::string Recoded::myToString ( const Rect< RectType > & rectangle)

Converts a Rect<T> object to its string representation.

This function formats a Rect<T> as ( x: <x>, y: <y>, width: <width>, height: <height> ), where <x>, <y>, <width>, and <height> are the string representations of the rectangle's properties. The string representations of the properties are generated using myToString.

Example:

Rect<int> rect = {{10, 20}, {100, 50}};
std::cout << myToString(rect);
// Output: ( x: 10, y: 20, width: 100, height: 50 )
A generic 2D rectangle class that holds position and size as pairs.
Definition Rect.hpp:38
const std::string myToString(const Rect< RectType > &rectangle)
Converts a Rect<T> object to its string representation.
Definition Rect.hpp:223
Template Parameters
RectTypeThe type of the rectangle's properties (e.g., int, float).
Parameters
rectangleThe Rect<T> object to convert to a string.
Returns
A string representation of the rectangle in the format ( x: <x>, y: <y>, width: <width>, height: <height> ).
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 223 of file Rect.hpp.

◆ myToString() [13/19]

template<typename Key , typename Value >
std::string Recoded::myToString ( const std::map< Key, Value > & map)

Converts a std::map to a string representation.

This function iterates over the key-value pairs of a std::map and generates a string in the format: ‘{ 'key1’ : 'value1', 'key2' : 'value2', ... }`.

Template Parameters
KeyThe type of the keys in the map.
ValueThe type of the values in the map.
Parameters
mapThe map to be converted to a string.
Returns
A string representing the map.
Note
Uses Recoded::myToString to convert keys and values to strings.

Definition at line 119 of file ToString.hpp.

◆ myToString() [14/19]

template<typename T1 , typename T2 >
const std::string Recoded::myToString ( const std::pair< T1, T2 > & value)

Converts a std::pair to its string representation.

This function formats the std::pair as ( x: <first>, y: <second> ), where <first> and <second> are the string representations of the pair's elements. The elements' string representations are generated using myToString.

Example:

std::pair<int, int> p = {1, 2};
std::cout << myToString(p); // Output: ( x: 1, y: 2 )
Template Parameters
T1The type of the first element in the pair.
T2The type of the second element in the pair.
Parameters
valueThe pair to convert.
Returns
A string representation of the pair in the format ( x: <first>, y: <second> ).
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 97 of file ToString.hpp.

◆ myToString() [15/19]

template<typename T >
std::string Recoded::myToString ( const std::set< T > & set)

Converts a std::set to a string representation.

This function iterates over the elements of a std::set and generates a string in the format: ‘{ 'element1’, 'element2', ... }`.

Template Parameters
TThe type of the elements in the set.
Parameters
setThe set to be converted to a string.
Returns
A string representing the set.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 147 of file ToString.hpp.

◆ myToString() [16/19]

template<typename Key , typename Value >
std::string Recoded::myToString ( const std::unordered_map< Key, Value > & map)

Converts a std::unordered_map to a string representation.

This function iterates over the key-value pairs of a std::unordered_map and generates a string in the format: ‘{ 'key1’ : 'value1', 'key2' : 'value2', ... }`.

Template Parameters
KeyThe type of the keys in the unordered map.
ValueThe type of the values in the unordered map.
Parameters
mapThe unordered map to be converted to a string.
Returns
A string representing the unordered map.
Note
Uses Recoded::myToString to convert keys and values to strings.

Definition at line 203 of file ToString.hpp.

◆ myToString() [17/19]

template<typename T >
const std::string Recoded::myToString ( const std::unordered_set< T > & set)

Converts a std::unordered_set to a string representation.

This function iterates over the elements of a std::unordered_set and generates a string in the format: ‘{ 'element1’, 'element2', ... }`.

Template Parameters
TThe type of the elements in the unordered set.
Parameters
setThe unordered set to be converted to a string.
Returns
A string representing the unordered set.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 231 of file ToString.hpp.

◆ myToString() [18/19]

template<typename T >
const std::string Recoded::myToString ( const std::vector< T > & set)

Converts a std::vector to a string representation.

This function iterates over the elements of a std::vector and generates a string in the format: ‘[ 'element1’, 'element2', ... ]`.

Template Parameters
TThe type of the elements in the vector.
Parameters
vecThe vector to be converted to a string.
Returns
A string representing the vector.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 174 of file ToString.hpp.

◆ myToString() [19/19]

template<typename T >
const std::string Recoded::myToString ( const T & value)

Converts a numeric value to its string representation.

This function is a wrapper around std::to_string and supports all types for which std::to_string is valid. It is intended for general use with numeric types like int, float, double, etc.

Template Parameters
TThe type of the value to convert. Must be a numeric type.
Parameters
valueThe value to convert.
Returns
A string representation of the numeric value.
Note
Uses Recoded::myToString to convert elements to strings.

Definition at line 69 of file ToString.hpp.

◆ operator!=()

template<typename T >
bool Recoded::operator!= ( const Rect< T > & lhs,
const Rect< T > & rhs )
constexpr

Inequality operators for the Rect.

Template Parameters
T
Parameters
lhs
rhs
Returns
true if the rectangles are different
false if the rectangles are identical

Definition at line 75 of file Rect.cpp.

◆ operator<<()

template<typename T >
std::ostream & Recoded::operator<< ( std::ostream & os,
const Rect< T > & rectangle )
inline

Operator in charge of outputing the values contained in the _rect when it is passed through a << operator.

Template Parameters
TA template to accept any form of rectangle
Parameters
osThe output stream
rectangleThe rectangle instance
Returns
std::ostream& An instance of output stream with the content of the rectangle appended to it.

Definition at line 112 of file Rect.hpp.

◆ operator==()

template<typename T >
bool Recoded::operator== ( const Rect< T > & lhs,
const Rect< T > & rhs )
constexpr

Overload that allows the user to check if 2 rect instances are identical.

Template Parameters
TThe typename
Parameters
lhs
rhs
Returns
true if the rectangles are the same
false if the rectangles are different

Definition at line 69 of file Rect.cpp.