Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
replay_view.h
Go to the documentation of this file.
1#ifndef REPLAY_VIEW_H
2#define REPLAY_VIEW_H
3
4#ifndef LOGIC_ONLY
5
7#include "replay.h"
8#include "controls_bar.h"
9#include "view.h"
10
11#include <SFML/Graphics.hpp>
12
13
15class replay_view : public view
16{
17public:
19
21 void draw_impl() override;
22
24 bool process_event_impl(sf::Event& e) override;
25
27 void process_resize_event_impl(sf::Event& event) override;
28
29 void set_replay(const replay& r);
30
32 void start_impl() override;
33
35 void stop_impl() override;
36
38 void tick_impl(const delta_t dt) override;
39
40 const auto& get_game() const noexcept { return m_replay.get_game(); }
41
42 const auto& get_layout() const noexcept { return m_layout; }
43
45 const auto& get_replayer() const noexcept { return m_replay; }
46
47 const auto& get_statistics() const noexcept { return m_statistics; }
48
49private:
50
51 controls_bar m_controls_bar;
52
54 replay m_replay;
55
57 game_statistics_in_time m_statistics;
58
60 replay_view_layout m_layout;
61};
62
64void draw_board(replay_view& v);
65
68
69
70#endif // LOGIC_ONLY
71
72#endif // REPLAY_VIEW_H
Definition controls_bar.h:12
A change of in_game_time}.
Definition delta_t.h:12
Definition game_statistics_in_time.h:8
The layout of a 'Played game' dialog.
Definition replay_view_layout.h:33
Dialog to view a played Conquer Chess game.
Definition replay_view.h:16
void process_resize_event_impl(sf::Event &event) override
Process a resize event.
Definition replay_view.cpp:47
void stop_impl() override
Clean up after this window has been shown.
Definition replay_view.cpp:83
const auto & get_layout() const noexcept
Definition replay_view.h:42
void set_replay(const replay &r)
Definition replay_view.cpp:69
const auto & get_replayer() const noexcept
The played game.
Definition replay_view.h:45
void draw_impl() override
Draw the menu on the main window.
Definition replay_view.cpp:58
void tick_impl(const delta_t dt) override
Run the game, until the user quits.
Definition replay_view.cpp:90
void start_impl() override
Prepare this window for being shown.
Definition replay_view.cpp:76
const auto & get_statistics() const noexcept
Definition replay_view.h:47
bool process_event_impl(sf::Event &e) override
Process an event.
Definition replay_view.cpp:22
const auto & get_game() const noexcept
Definition replay_view.h:40
replay_view()
Definition replay_view.cpp:17
A replay.
Definition replay.h:23
const auto & get_game() const noexcept
Get the current state of the game.
Definition replay.h:37
The abstract base class of all other views.
Definition view.h:26
void draw_board(replay_view &v)
Draw the board.
Definition replay_view.cpp:98
void draw_statistics(replay_view &v)
Draw the statistics.
Definition replay_view.cpp:114