diff options
Diffstat (limited to 'src/game_tab/left_panel/board/BoardCanvas.hpp')
| -rw-r--r-- | src/game_tab/left_panel/board/BoardCanvas.hpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/game_tab/left_panel/board/BoardCanvas.hpp b/src/game_tab/left_panel/board/BoardCanvas.hpp index b26526f..7b6ccf7 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.hpp +++ b/src/game_tab/left_panel/board/BoardCanvas.hpp @@ -58,6 +58,16 @@ typedef struct AnimState { wxPoint transVect; } AnimState; +typedef struct GameState { + std::string white, black; + std::string board; + std::map<char, std::uint8_t> captures; + bool is_black_turn; + bool mat_black; + bool mat_white; + ClockTime black_time, white_time; +} GameState; + class BoardCanvas : public wxPanel { // *t is theme for board+pieces and // *t_captures is theme for captured pieces (scale down version of t) @@ -73,11 +83,11 @@ class BoardCanvas : public wxPanel { wxSize canvas_size; wxPoint active_square; std::map<char, std::uint8_t> captures; - ClockTime black_time, white_time; bool frozen,lock_square_size; // Current animation state AnimState adata; + GameState gs; public: BoardCanvas(wxFrame *parent); @@ -89,10 +99,8 @@ public: void MouseEvent(wxMouseEvent &event); void Zoom(std::int32_t zoom); void Swap(); - void SetupBoard(std::string board, bool is_black_turn, - std::map<char, std::uint8_t> captures, - std::string white_player, std::string black_player); - void Animate(const std::string &board, bool is_black_turn, std::map<char, std::uint8_t> captures, std::string src, std::string dst,bool faster); + void OnResize(wxSizeEvent &e); + void SetupBoard(const GameState &new_gs); + void Animate(const GameState &new_gs, std::string src, std::string dst,bool faster); void SetClockTime(short hours, short min, short sec, bool IsBlack); - DECLARE_EVENT_TABLE() }; |
