Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
lobby_view_layout.h
Go to the documentation of this file.
1#ifndef LOBBY_VIEW_LAYOUT_H
2#define LOBBY_VIEW_LAYOUT_H
3
4#include "side.h"
5#include "lobby_view_item.h"
6#include "read_only.h"
7#include "screen_rect.h"
8#include "layout.h"
9
10#include <map>
11#include <vector>
12
53{
54public:
55 explicit lobby_view_layout(
57 const int margin_width = get_default_margin_width()
58 );
59
60 const auto& get_background() const noexcept { return m_background; }
61 const screen_rect& get_color(const side player_side) const noexcept;
62 const screen_rect& get_king_portrait(const side player_side) const noexcept;
63 const screen_rect& get_race(const side player_side) const noexcept;
64 const screen_rect& get_ready(const side player_side) const noexcept;
65 const auto& get_title() const noexcept { return m_title; }
66
67private:
68
69
70
71 screen_rect m_background;
72
73 std::map<side, screen_rect> m_color;
74 std::map<side, screen_rect> m_king_portrait;
75 std::map<side, screen_rect> m_race;
76 std::map<side, screen_rect> m_ready;
77 screen_rect m_title;
78
79 std::map<side, screen_rect> m_cursor;
80};
81
84 const lobby_view_layout& layout,
85 const lobby_view_item item,
86 const side player_side
87) noexcept;
88
90std::vector<screen_rect> get_panels(const lobby_view_layout& layout);
91
94
95#endif // LOBBY_VIEW_LAYOUT_H
The layout of the Lobby dialog.
Definition lobby_view_layout.h:53
const screen_rect & get_color(const side player_side) const noexcept
Definition lobby_view_layout.cpp:89
const screen_rect & get_king_portrait(const side player_side) const noexcept
Definition lobby_view_layout.cpp:94
const auto & get_title() const noexcept
Definition lobby_view_layout.h:65
const auto & get_background() const noexcept
Definition lobby_view_layout.h:60
const screen_rect & get_race(const side player_side) const noexcept
Definition lobby_view_layout.cpp:113
const screen_rect & get_ready(const side player_side) const noexcept
Definition lobby_view_layout.cpp:118
A rectangle-shaped area on the screen.
Definition screen_rect.h:15
constexpr int get_default_margin_width() noexcept
Get the default margin width/size, in pixels.
Definition layout.h:7
lobby_view_item
The items in the Lobby.
Definition lobby_view_item.h:10
void test_lobby_view_layout()
Test the lobby_view_layout class.
Definition lobby_view_layout.cpp:140
std::vector< screen_rect > get_panels(const lobby_view_layout &layout)
Get the panels in the layout.
Definition lobby_view_layout.cpp:99
const screen_rect & get_cursor_rect(const lobby_view_layout &layout, const lobby_view_item item, const side player_side) noexcept
Get the rectangle of the item.
Definition lobby_view_layout.cpp:123
screen_rect get_default_screen_rect() noexcept
Get the default screen rectangle.
Definition screen_rect.cpp:140
side
The side the player/piece is on.
Definition side.h:11