R-Type
2
Doom but in better
Loading...
Searching...
No Matches
WinSystem.cpp
Go to the documentation of this file.
1
#include "
WinSystem.hpp
"
2
#include "
Registry.hpp
"
3
#include "
GameMessage.hpp
"
4
5
namespace
Win
{
6
int
enemies_left
= 3;
7
}
8
9
bool
game_won
=
false
;
10
11
void
win_system
(
Registry
&
r
)
12
{
13
if
(
game_won
)
return
;
14
if
(
Win::enemies_left
<= 0) {
15
r
.
dispatcher
->
notify
({
P_STATUS
, 0, {1, 0, 0,
""
, {0, 0}}});
16
game_won
=
true
;
17
}
18
}
GameMessage.hpp
P_STATUS
@ P_STATUS
Represents a status event.
Definition
GameMessage.hpp:25
Registry.hpp
r
Registry * r
Definition
Tests.cpp:4
win_system
void win_system(Registry &r)
Definition
WinSystem.cpp:11
game_won
bool game_won
Definition
WinSystem.cpp:9
WinSystem.hpp
EventDispatcher::notify
void notify(const GameMessage &event)
Notifies the subscribed listener of an event.
Definition
EventDispatcher.hpp:39
Registry
Manages entities and their associated components, enabling the creation, deletion,...
Definition
Registry.hpp:23
Registry::dispatcher
EventDispatcher * dispatcher
Definition
Registry.hpp:191
Win
Definition
WinSystem.hpp:5
Win::enemies_left
int enemies_left
Definition
WinSystem.cpp:6
game_source
systems
WinSystem.cpp
Generated on Thu Feb 6 2025 22:34:20 for R-Type by
1.12.0