From a359219e33fdf3afb5ddfbb084563054a947b106 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sat, 12 Feb 2022 19:13:34 +0100 Subject: Create project --- src/CGEHalfMove.hpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/CGEHalfMove.hpp (limited to 'src/CGEHalfMove.hpp') diff --git a/src/CGEHalfMove.hpp b/src/CGEHalfMove.hpp new file mode 100644 index 0000000..2ed7516 --- /dev/null +++ b/src/CGEHalfMove.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include +#include + +namespace cgeditor { + +/** + * @brief Move (mainlines and variations) displayed in the editor + * + */ +class CGEHalfMove { + /// @brief Comment linked to the move + std::string comment; + /// @brief Number of line in @a comment + std::uint16_t NbLineComment = 0; + +public: + CGEHalfMove(); + CGEHalfMove(CGEHalfMove *parent); + CGEHalfMove(std::string move); + + /// @brief CUrrent move number + std::uint16_t Number; + /// @brief Current move value + std::string move; + + CGEHalfMove *MainLine; + CGEHalfMove *Parent; + bool IsBlack; + /// @brief Says if variations of that move must be drawn + bool Folded = false; + /// @brief Says if this move must be drawn + bool Hide = false; + /// @brief Variations of the move + std::vector variations; + + /// @brief Set comment and update number of lines + void SetComment(const std::string &c); + /// @brief Get current value of comment + std::string GetComment(); + /// @brief Get number of lines in comment + std::uint16_t GetNbLineComment(); + /// @brief Remove a move from the MainLine and/or variations + void RemoveChild(CGEHalfMove *m); +}; +} // namespace cgeditor \ No newline at end of file -- cgit v1.2.3