17#include <SFML/Graphics.hpp>
46 const auto&
get_layout() const noexcept {
return m_layout; }
49 const auto&
get_log() const noexcept {
return m_log; }
98 void play_pieces_sound_effects();
101 void process_piece_messages();
104 void show_mouse_cursor();
122 const side player_side
152 const sf::Event& event,
163 const bool show_occupied
chess_color
A chess piece color.
Definition chess_color.h:10
Definition controls_bar.h:12
A change of in_game_time}.
Definition delta_t.h:12
The class that acts as a controller for game}.
Definition game_controller.h:31
const game & get_game() const noexcept
Get the game.
Definition game_controller.h:48
An exact coordinate anywhere on the board.
Definition game_coordinate.h:32
The text log in the game.
Definition game_log.h:14
Options for the game.
Definition game_options.h:18
Definition game_statistics_in_time.h:8
File to save the game statistics too.
Definition game_statistics_output_file.h:11
The layout of the Game dialog.
Definition game_view_layout.h:61
The Game dialog.
Definition game_view.h:27
void draw_impl() override
Show the game on-screen.
Definition game_view.cpp:230
const auto & get_layout() const noexcept
Definition game_view.h:46
game_view()
Definition game_view.cpp:33
void set_game_options(const game_options &go) noexcept
Definition game_view.h:62
void start_impl() override
Prepare this window for being shown.
Definition game_view.cpp:639
const auto & get_game() const noexcept
Definition game_view.h:40
void stop_impl() override
Clean up after this window has been shown.
Definition game_view.cpp:661
double get_elapsed_time_secs() const noexcept
The the elapsed time in seconds.
Definition game_view.cpp:87
void process_resize_event_impl(sf::Event &event) override
Process a resize events.
Definition game_view.cpp:185
bool process_event_impl(sf::Event &event) override
Process all events.
Definition game_view.cpp:159
void set_lobby_options(const lobby_options &lo) noexcept
Definition game_view.cpp:633
const auto & get_game_options() const noexcept
Definition game_view.h:44
void tick_impl(delta_t dt) override
Run the game, until the user quits.
Definition game_view.cpp:44
const auto & get_log() const noexcept
Get the text log, i.e. things pieces have to say.
Definition game_view.h:49
replay get_replay() const
Definition game_view.cpp:114
const auto & get_physical_controllers() const noexcept
Definition game_view.h:51
const auto & get_game_controller() const noexcept
Definition game_view.h:42
The in-game time, in chess moves.
Definition in_game_time.h:16
The options that are set in the lobby.
Definition lobby_options.h:16
A physical controller.
Definition physical_controller.h:19
The physical controllers used by all players.
Definition physical_controllers.h:12
A replay.
Definition replay.h:23
The abstract base class of all other views.
Definition view.h:26
const in_game_time & get_time(const game_view &v) noexcept
Get the time in the game.
Definition game_view.cpp:154
const game_view_layout & get_layout(const game_view &v) noexcept
Get the layout.
Definition game_view.cpp:104
sf::RectangleShape create_white_square(game_view &view)
Create a white/ligt square at the right size.
void draw_unit_paths(game_view &view)
Show the planned paths for the units on-screen.
Definition game_view.cpp:587
void draw_board(game_view &view, const bool show_occupied)
Show the board: squares, unit paths, pieces, health bars.
Definition game_view.cpp:273
void show_occupied_squares(game_view &view)
Show the squares that are occupied on-screen Throws if this option is turned off.
Definition game_view.cpp:458
void draw_unit_health_bars(game_view &view)
Show the pieces' health bars on-screen.
Definition game_view.cpp:578
bool would_be_valid(const game_view &view, chess_color player_color)
Would it be a valid move if the user would press LMB or RMB?
Definition game_view.cpp:676
void show_sidebar(game_view &view, const side player_side)
Show the info on the side-bar on-screen for a player.
void draw_navigation_controls(game_view &view)
Show the controls (e.g. for a unit) on-screen for a player.
Definition game_view.cpp:369
std::string get_last_log_messages(const game_view &v, const side player) noexcept
Get the last log messages for a player.
Definition game_view.cpp:93
void test_game_view()
OCLINT tests may be many.
Definition game_view.cpp:670
void draw_controls(game_view &view, const side player)
Show the controls (e.g. for a unit) on-screen for a player.
Definition game_view.cpp:296
void draw_unit_info(game_view &view, const side player_side)
Show the selected unit(s) on-screen for a player.
Definition game_view.cpp:595
sf::RectangleShape create_black_square(game_view &view)
Create a black/dark square at the right size.
std::vector< std::string > get_controls_texts(const game_controller &c, const side player_side)
Get the controls text for a player with a controller.
Definition game_view.cpp:135
physical_controller_type get_physical_controller_type(const game_view &view, const side player)
Get the controller type for a certain side.
Definition game_view.cpp:82
void draw_log(game_view &view, const side player)
Show the log on-screen, i.e. things the pieces say.
Definition game_view.cpp:432
void draw_cursor(game_view &view, const side player)
Show the highlighted square under the cursor on-screen for a player.
Definition game_view.cpp:528
void show_debug(game_view &view, const side player_side)
Show debug info on-screen for a player.
Definition game_view.cpp:382
void draw_possible_moves(game_view &view)
Show the possible moves for the selected pieces.
Definition game_view.cpp:494
void draw_game_statistics_widget(game_view &view)
Show the game info, e.g. the time.
Definition game_view.cpp:361
const game_coordinate & get_cursor_pos(const game_view &view, const side player) noexcept
Get the player position.
Definition game_view.cpp:130
void draw_background(game_view &view)
Show the map of the window.
Definition game_view.cpp:448
void process_event(game_controller &c, const physical_controllers &pc, const sf::Event &event, const game_view_layout &layout)
Process the event, by letting the controllers add actions to the game sf::Event -> controllers -> con...
Definition game_view.cpp:199
const physical_controller & get_physical_controller(const game_view &view, const side player)
Get the controller for a certain side.
Definition game_view.cpp:77
void draw_squares(game_view &view)
Show the squares of the board on-screen.
Definition game_view.cpp:523
void draw_pieces(game_view &view)
Show the pieces of the board on-screen.
Definition game_view.cpp:483
const std::vector< piece > & get_pieces(const game_view &v) noexcept
Get the pieces.
Definition game_view.cpp:109
physical_controller_type
The type of controller.
Definition physical_controller_type.h:15
side
The side the player/piece is on.
Definition side.h:11