diff options
Diffstat (limited to 'src/game_tab/left_panel/board/Theme.hpp')
| -rw-r--r-- | src/game_tab/left_panel/board/Theme.hpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/game_tab/left_panel/board/Theme.hpp b/src/game_tab/left_panel/board/Theme.hpp index c3acf10..ccf4949 100644 --- a/src/game_tab/left_panel/board/Theme.hpp +++ b/src/game_tab/left_panel/board/Theme.hpp @@ -12,6 +12,10 @@ #define DEFAULT_PIECE_THEME "assets/pieces/cburnett.png" #define DEFAULT_SQUARE_THEME "assets/boards/chesscom_8bits.png" +/** + * @brief The in memory board theme (used by BoardCanvas) + * + */ class Theme { private: std::unordered_map<char, wxImage> skin; @@ -21,18 +25,30 @@ private: public: Theme(); + /// @brief Create piece using two png file path Theme(std::string piece, std::string square); ~Theme(); + /// @brief Load piece skin image (break image tile into individual pieces) void LoadPiecesSkin(wxImage skin); + /// @brief Load square skin image (break the 2 square tiles into individual squares) void LoadSquaresSkin(wxImage iskin); + /// @brief Set pieces width void ResizePieces(std::uint32_t width); + /// @brief Set squares width void ResizeSquares(std::uint32_t width); + /// @brief Set square width and adjust piece size accordingly void ResizeSquaresAndPieces(std::uint32_t width); + /// @brief Having rounded corners on squares void SetSquareRadius(std::uint8_t radius); std::uint8_t GetSquareRadius(); bool Zoom(int amount); double GetPiecesSizes(); double GetSquaresSizes(); - + /** + * @brief Get bitmap of an element + * + * @param c For black pieces rnbkqp for white pieces RNBKQP and # for mate symbol and s for black square and S for white square + * @return wxBitmap* + */ wxBitmap *Get(char c); }; |
