R-Type
RType.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2023
3 ** RType.hpp
4 ** File description:
5 ** RType
6 */
7 
8 #ifndef RTYPE_HPP_
9 #define RTYPE_HPP_
10 
11 #include <map>
12 #include <string>
13 #include <utility>
14 #include <cstdint>
15 #include <any>
16 
17 namespace RType
18 {
19  static const std::size_t MAX_BUFFER_SIZE = 65535;
20  static const std::size_t HEADER_SIZE = 8;
21  static const uint32_t MAGIC_NUMBER = 0xA54CDEF5;
22  static const float PLAYER_SPEED = 100.0f;
23 
24  enum class GameState : uint8_t { GAME = 0, WIN, LOSE };
25 
26  enum class PacketType : uint8_t { STRING = 10, CONNEXION, DESTROY, SCORE };
27 
29 
30  struct Event
31  {
32  uint8_t packetType;
33  unsigned short port;
34  std::any data;
35  };
36 } // namespace RType
37 
38 #endif /* !RTYPE_HPP_ */
Definition: Protocol.hpp:14
PacketType
Definition: RType.hpp:26
GameState
Definition: RType.hpp:24
TextureType
Definition: RType.hpp:28
Definition: RType.hpp:31
unsigned short port
Definition: RType.hpp:33
uint8_t packetType
Definition: RType.hpp:32
std::any data
Definition: RType.hpp:34