-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinner_screen_sfml.h
55 lines (40 loc) · 1.07 KB
/
winner_screen_sfml.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef WINNER_SCREEN_SFML_H
#define WINNER_SCREEN_SFML_H
#include <cassert>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include "program_state.h"
#include "winner_screen.h"
class winner_screen_sfml
{
public:
winner_screen_sfml(
sf::RenderWindow& w,
int winner,
const bool do_play_music = true
);
///Get the current state of the program
program_state get_state() const noexcept { return m_state; }
void execute();
private:
///Will music be played?
bool m_do_play_music;
///The logic behind this menu
winner_screen m_menu;
///Music played, starts at constructor, ends at destructor
sf::Music m_music;
///The current state of the program
program_state m_state;
///Window used for displayal
sf::RenderWindow& m_window;
///The winner of the game
int m_winner;
///Text of which player has won
sf::Text m_winner_text;
///Show this menu on the screen
void display();
///Process a single event
void process_event(const sf::Event& event);
};
sf::Text create_winner_text(const int winner);
#endif // WINNER_SCREEN_SFML_H