Eile Mit Weile
Loading...
Searching...
No Matches
MainGamePanel.hpp
1#ifndef EILE_MIT_WEILE_MAINGAMEPANEL_HPP
2#define EILE_MIT_WEILE_MAINGAMEPANEL_HPP
3#include <wx/wx.h>
4#include "common/gameState/GameState.hpp"
6#include <map>
7
19class MainGamePanel: public wxPanel {
20public:
21 MainGamePanel(wxWindow* parent);
23 void BuildGameState(GameState* game_state, Player* me);
24
25private:
26 void BuildBoard(wxPanel* parent, GameState* game_state, Player* me);
28 void BuildFigures(GameState* game_state, Player* me);
29 void BuildTurnIndicator(GameState* game_state, Player* me);
30 void BuildDice(wxPanel* parent, GameState* game_state, Player* me);
31 void ShowNoMoves(GameState* game_state, Player* me);
38 wxPanel* _board_panel;
39 // Side displays the players names, the turn indicator and the dice
40
45 wxPanel* _side_panel;
46
47 std::map<int, std::pair<std::basic_string<char>, wxColour>> _color_map;
55 std::map<unsigned, std::pair<wxPoint, wxSize>> _spaces_map;
56
57 // size of spaces for both orientations
58 unsigned const _space_width = 72;
59 unsigned const _space_height = 29;
62 unsigned const _board_length = 680; unsigned const _border_size = 10;
64 // size and position of board panel
66 wxPoint const _board_panel_position = wxPoint(0, 0);
68 // size and position of side panel
69 wxSize const _side_panel_size = wxSize(960 - _board_length - _border_size, _board_length);
70 wxPoint const _side_panel_position = wxPoint(_board_length + _border_size, 0);
72 // size and position of dice (relative to side panel)
73 wxSize const _dice_size = wxSize(50, 50);
74 wxPoint const _dice_position = wxPoint(50, _side_panel_size.GetHeight() - 100);
77 wxSize const _figure_size = wxSize(20, 20);
78 wxSize const _home_field_size = wxSize(40, 40);
80 unsigned const _home_field_offset = 3 * _space_width / 2;
85 wxPoint const _north = wxPoint(_board_length / 2 - 1.5 * _space_width, 0);
86 wxPoint const _east = wxPoint(680 - 8 * _space_height, _board_length / 2 - 1.5 * _space_width);
87 wxPoint const _south = wxPoint(_board_length / 2 - 1.5 * _space_width, 680 - 8 * _space_height);
88 wxPoint const _west = wxPoint(0, _board_length / 2 - 1.5 * _space_width);
91};
92
93
94#endif //EILE_MIT_WEILE_MAINGAMEPANEL_HPP
Holds the state of one game.
Definition GameState.hpp:22
Panel for displaying the main game.
Definition MainGamePanel.hpp:19
wxSize const _figure_size
Definition MainGamePanel.hpp:77
unsigned const _space_width
Definition MainGamePanel.hpp:58
void ShowNoMoves(GameState *game_state, Player *me)
Definition MainGamePanel.cpp:433
void BuildTurnIndicator(GameState *game_state, Player *me)
Definition MainGamePanel.cpp:387
wxPoint const _board_panel_position
Definition MainGamePanel.hpp:66
wxPanel * _board_panel
Definition MainGamePanel.hpp:38
MainGamePanel(wxWindow *parent)
Definition MainGamePanel.cpp:9
std::map< int, std::pair< std::basic_string< char >, wxColour > > _color_map
Definition MainGamePanel.hpp:47
wxSize const _dice_size
Definition MainGamePanel.hpp:73
std::map< unsigned, std::pair< wxPoint, wxSize > > _spaces_map
Definition MainGamePanel.hpp:55
wxSize const _home_field_size
Definition MainGamePanel.hpp:78
unsigned const _board_length
Definition MainGamePanel.hpp:62
void BuildDice(wxPanel *parent, GameState *game_state, Player *me)
Definition MainGamePanel.cpp:403
wxSize const _side_panel_size
Definition MainGamePanel.hpp:69
unsigned const _space_height
Definition MainGamePanel.hpp:59
wxPoint const _dice_position
Definition MainGamePanel.hpp:74
void BuildBoard(wxPanel *parent, GameState *game_state, Player *me)
Definition MainGamePanel.cpp:158
unsigned const _border_size
Definition MainGamePanel.hpp:62
wxPoint const _side_panel_position
Definition MainGamePanel.hpp:70
wxSize _space_horizontal
Definition MainGamePanel.hpp:60
unsigned const _home_field_offset
Definition MainGamePanel.hpp:80
wxSize _space_vertical
Definition MainGamePanel.hpp:61
void BuildFigures(GameState *game_state, Player *me)
Definition MainGamePanel.cpp:283
wxSize const _board_panel_size
Definition MainGamePanel.hpp:65
wxPanel * _side_panel
Definition MainGamePanel.hpp:45
Holds all relevant information of a player.
Definition Player.hpp:27