|
Eile Mit Weile
|
Panel for displaying the main game. More...
#include <MainGamePanel.hpp>
Public Member Functions | |
| MainGamePanel (wxWindow *parent) | |
| void | BuildGameState (GameState *game_state, Player *me) |
Private Member Functions | |
| void | BuildBoard (wxPanel *parent, GameState *game_state, Player *me) |
| void | BuildFigures (GameState *game_state, Player *me) |
| void | BuildTurnIndicator (GameState *game_state, Player *me) |
| void | BuildDice (wxPanel *parent, GameState *game_state, Player *me) |
| void | ShowNoMoves (GameState *game_state, Player *me) |
Panel for displaying the main game.
This class is derived from wxPanel, which is wxWidgets' panel class. It is responsible for displaying the main game. The board is manually constructed, where notably each space is a wxPanel and each figure is an ImagePanel. The panel also has a dice button and a turn indicator.
The layout is not scalable!
| MainGamePanel::MainGamePanel | ( | wxWindow * | parent | ) |
Initializes the MainGamePanel with the given parent window (GameWindow).
Builds/Updates the dice.
Builds/Updates the figures of the player.
Builds/Updates the turn indicator.
If me has no playable figures, a message box tells that to the Player and a GameController::SkipTurn is called.
|
private |
The GUI is separated into _board_panel and _side_panel. Board consists of the board and all figures
The position of the board panel.
|
private |
The size of the board panel.
The size of the border between the board and the side panel.
Maps the index of the color to the name of the color as a string.
|
private |
The position of the Dice button.
|
private |
The offset of the home fields.
|
private |
The GUI is separated into _board_panel and _side_panel. Side displays the players names, the turn indicator and the dice
|
private |
The position of the side panel.
|
private |
The size of the side panel.
|
private |
The size of a space in horizontal orientation.
|
private |
The size of a space in vertical orientation.
Maps the index of the space to the position and size of space 0 - 95 : normal, bench and ladder spaces (according to numbering convention in Board) 96 : finish area space 97 - 100 : home fields