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
5namespace Win {
6 int enemies_left = 3;
7}
8
9bool game_won = false;
10
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}
@ P_STATUS
Represents a status event.
Registry * r
Definition Tests.cpp:4
void win_system(Registry &r)
Definition WinSystem.cpp:11
bool game_won
Definition WinSystem.cpp:9
void notify(const GameMessage &event)
Notifies the subscribed listener of an event.
Manages entities and their associated components, enabling the creation, deletion,...
Definition Registry.hpp:23
EventDispatcher * dispatcher
Definition Registry.hpp:191
int enemies_left
Definition WinSystem.cpp:6