R-Type
include
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
28
enum class
TextureType
: uint8_t {
NONE
= 1,
PLAYER
,
SIMPLE_SHOOT
,
CHARGED_SHOOT
,
SIMPLE_MOB
,
MEDIUM_MOB
};
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_ */
RType
Definition:
Protocol.hpp:14
RType::PacketType
PacketType
Definition:
RType.hpp:26
RType::PacketType::STRING
@ STRING
RType::PacketType::CONNEXION
@ CONNEXION
RType::PacketType::DESTROY
@ DESTROY
RType::PacketType::SCORE
@ SCORE
RType::GameState
GameState
Definition:
RType.hpp:24
RType::GameState::GAME
@ GAME
RType::GameState::LOSE
@ LOSE
RType::GameState::WIN
@ WIN
RType::TextureType
TextureType
Definition:
RType.hpp:28
RType::TextureType::PLAYER
@ PLAYER
RType::TextureType::CHARGED_SHOOT
@ CHARGED_SHOOT
RType::TextureType::MEDIUM_MOB
@ MEDIUM_MOB
RType::TextureType::SIMPLE_SHOOT
@ SIMPLE_SHOOT
RType::TextureType::SIMPLE_MOB
@ SIMPLE_MOB
RType::TextureType::NONE
@ NONE
RType::Event
Definition:
RType.hpp:31
RType::Event::port
unsigned short port
Definition:
RType.hpp:33
RType::Event::packetType
uint8_t packetType
Definition:
RType.hpp:32
RType::Event::data
std::any data
Definition:
RType.hpp:34
Generated by
1.9.1