R-Type  2
Doom but in better
Loading...
Searching...
No Matches
OperatorRebind.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** rtype (Workspace)
4** File description:
5** OperatorRebind.hpp
6*/
7
8#pragma once
9#include <map>
10#include <set>
11#include <vector>
12#include <utility>
13#include <ostream>
14#include <unordered_set>
15#include <unordered_map>
16#include "Recoded/ToString.hpp"
24
25namespace Utilities
26{
38 inline std::ostream &operator<<(std::ostream &os, const bool &item)
39 {
40 os << Recoded::myToString(item);
41 return os;
42 };
43
58 template<typename T1, typename T2>
59 inline std::ostream &operator<<(std::ostream &os, const std::pair<T1, T2> &item)
60 {
61 os << Recoded::myToString(item);
62 return os;
63 };
64
78 template<typename T>
79 inline std::ostream &operator<<(std::ostream &os, const std::vector<T> &set)
80 {
82 return os;
83 }
84
98 template<typename Key, typename Value>
99 inline std::ostream &operator<<(std::ostream &os, const std::unordered_map<Key, Value> &map)
100 {
101 os << Recoded::myToString(map);
102 return os;
103 }
104
118 template<typename T>
119 inline std::ostream &operator<<(std::ostream &os, const std::set<T> &set)
120 {
122 return os;
123 }
124
138 template<typename T>
139 inline std::ostream &operator<<(std::ostream &os, const std::unordered_set<T> &set)
140 {
142 return os;
143 }
144
156 inline std::ostream &operator<<(std::ostream &os, const ActiveScreen &item)
157 {
158 os << Recoded::myToString(item);
159 return os;
160 };
161
173 inline std::ostream &operator<<(std::ostream &os, const GUI::ECS::GameComponents::Package_t &item)
174 {
175 os << Recoded::myToString(item);
176 return os;
177 };
178
190 inline std::ostream &operator<<(std::ostream &os, const GUI::ECS::GameComponents::EntityType &item)
191 {
192 os << Recoded::myToString(item);
193 return os;
194 };
195
207 inline std::ostream &operator<<(std::ostream &os, const GUI::ECS::GameComponents::ECSPackage_t &item)
208 {
209 os << Recoded::myToString(item);
210 return os;
211 };
212
224 inline std::ostream &operator<<(std::ostream &os, const GUI::ECS::GameComponents::EntityActions_t &item)
225 {
226 os << Recoded::myToString(item);
227 return os;
228 };
229
241 inline std::ostream &operator<<(std::ostream &os, const GUI::ECS::GameComponents::EntityActionType &item)
242 {
243 os << Recoded::myToString(item);
244 return os;
245 };
246
258 inline std::ostream &operator<<(std::ostream &os, const GUI::ECS::Systems::ActiveShape &item)
259 {
260 os << Recoded::myToString(item);
261 return os;
262 };
263
275 inline std::ostream &operator<<(std::ostream &os, const GUI::Network::MessageType &item)
276 {
277 os << Recoded::myToString(item);
278 return os;
279 };
280
292 inline std::ostream &operator<<(std::ostream &os, const GUI::Network::MessageInfo &item)
293 {
294 os << Recoded::myToString(item);
295 return os;
296 };
297
309 inline std::ostream &operator<<(std::ostream &os, const GUI::Network::MessageNode &item)
310 {
311 os << Recoded::myToString(item);
312 return os;
313 };
314}
315
326using Utilities::operator<<;
ActiveScreen
This is the enum class in charge of the window switcher code. This enum allows the mainloop of the pr...
Enum for the different types of messages that can be eschanged with the server.
Provides custom string conversion functions as alternatives to std::to_string.
ActiveShape
Enum representing different types of shapes managed by the ShapeComponent.
MessageType
Enum for the different message types in the UDP protocol.
const std::string myToString(const Rect< RectType > &rectangle)
Converts a Rect<T> object to its string representation.
Definition Rect.hpp:223
std::ostream & operator<<(std::ostream &os, const bool &item)
Outputs a boolean value to the given output stream using a custom string representation.
lib set(SERVER_SOURCES main.cpp src/server.cpp src/client_manager.cpp src/game_manager.cpp) add_executable(r-type_server $