RType
src
lib
r_type
Scenes
IScene.hpp
Go to the documentation of this file.
1
/*
2
** EPITECH PROJECT, 2023
3
** R-type
4
** File description:
5
** R-type
6
*/
7
8
#
pragma
once
9
10
#
include
"../../networking/server/ServerSocket.hpp"
11
#
include
"../components/IComponent.hpp"
12
#
include
"../entities/IEntity.hpp"
13
#
include
"../services/Animation.hpp"
14
#
include
"../services/Graphic.hpp"
15
#
include
"../services/IService.hpp"
16
#
include
"../services/TimeManagement.hpp"
17
#
include
<
memory
>
18
#
include
<
vector
>
19
20
class
ISceneRType
21
{
22
public
:
23
24
/**
25
* @brief Construct a new IScene:: IScene object
26
* @param serverSocket
27
*/
28
virtual
~
ISceneRType
() =
default
;
29
30
/**
31
* @brief display, display the scene
32
*/
33
virtual
void
display
() = 0;
34
35
/**
36
* @brief update, update the scene
37
* @param event
38
* @param packet
39
*/
40
virtual
void
update
(std::shared_ptr<Event> event, std::shared_ptr<Packet> packet) = 0;
41
42
/**
43
* @brief pauseScene, pause the scene
44
*/
45
virtual
void
pauseScene
() = 0;
46
47
/**
48
* @brief resumeScene, resume the scene
49
*/
50
virtual
void
resumeScene
() = 0;
51
52
/**
53
* @brief stopScene, stop the scene
54
*/
55
virtual
void
stopScene
() = 0;
56
57
/**
58
* @brief restartScene, restart the scene
59
*/
60
virtual
void
restartScene
() = 0;
61
62
63
/**
64
* @brief addEntity, add an entity
65
* @param entity
66
*/
67
virtual
void
addEntity
(std::shared_ptr<
IEntity
> entity) = 0;
68
69
/**
70
* @brief getEntities, get the entities
71
* @return entities (std::vector<std::shared_ptr<IEntity>>)
72
*/
73
virtual
std
::
vector
<
std
::
shared_ptr
<
IEntity
>>
getEntities
() = 0;
74
75
76
/**
77
* @brief addService, add a service
78
* @param service
79
*/
80
virtual
void
addService
(std::shared_ptr<
IService
> service) = 0;
81
82
/**
83
* @brief getServices, get the services
84
* @return services (std::vector<std::shared_ptr<IService>>)
85
*/
86
virtual
std
::
vector
<
std
::
shared_ptr
<
IService
>>
getServices
() = 0;
87
88
89
/**
90
* @brief sendGameState, send the game state to a client
91
* @param clientId
92
*/
93
virtual
void
sendGameState
(
int
clientId) = 0;
94
95
/**
96
* @brief broadcastGameState, broadcast the game state
97
*/
98
virtual
void
broadcastGameState
() = 0;
99
100
101
/**
102
* @brief initEntities, init the entities
103
*/
104
virtual
void
initEntities
() = 0;
105
106
/**
107
* @brief initServices, init the services
108
*/
109
virtual
void
initServices
() = 0;
110
111
protected
:
112
std
::
vector
<
std
::
shared_ptr
<
IEntity
>>
_entities
;
113
std
::
vector
<
std
::
shared_ptr
<
IService
>>
_services
;
114
std::shared_ptr<
ServerSocket
>
_serverSocket
;
115
};
Generated by
1.9.1