Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
main_window.h
Go to the documentation of this file.
1#ifndef MAIN_WINDOW_H
2#define MAIN_WINDOW_H
3
4#ifndef LOGIC_ONLY
5
6#include "ccfwd.h"
7#include "sleep_scheduler.h"
8#include "program_state.h"
9#include "game_options.h"
10#include "lobby_options.h"
11#include "replay.h"
12#include "view.h"
13
14#include <SFML/Graphics.hpp>
15
16#include <memory>
17#include <map>
18
21{
22public:
24
26 void exec();
27
28 const auto& get_program_state() const noexcept { return m_program_state; }
29
30private:
31
32 std::map<program_state, std::unique_ptr<view>> m_views;
33
34 game_options m_game_options;
35
39 lobby_options m_lobby_options;
40
42 replay m_replay;
43
45 sleep_scheduler m_sleep_scheduler;
46
48
51 bool process_events();
52
55 bool process_event(sf::Event& event);
56
57 void process_resize_event(sf::Event& event);
58
59
63 void set_new_state(const program_state s);
64
66 void show();
67
69 void show_debug_info();
70
75 void tick();
76
77};
78
79void test_main_window();
80
81#endif // LOGIC_ONLY
82
83#endif // MAIN_WINDOW_H
Options for the game.
Definition game_options.h:18
The options that are set in the lobby.
Definition lobby_options.h:16
The single main window.
Definition main_window.h:21
const auto & get_program_state() const noexcept
Definition main_window.h:28
main_window()
Definition main_window.cpp:23
void exec()
Run the window, until the user quits.
Definition main_window.cpp:71
A replay.
Definition replay.h:23
Sleeps enough to reach 50-60 frames per second.
Definition sleep_scheduler.h:8
void test_main_window()
Definition main_window.cpp:258
program_state
Definition program_state.h:7