From a84b210ca397194ad360175cf89451f319121e6c Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Thu, 19 Jan 2023 13:06:36 +0100 Subject: Integrate CMI --- src/components/MoveTable.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/components/MoveTable.hpp') diff --git a/src/components/MoveTable.hpp b/src/components/MoveTable.hpp index 28ebd12..e357287 100644 --- a/src/components/MoveTable.hpp +++ b/src/components/MoveTable.hpp @@ -1,5 +1,6 @@ #include "Component.hpp" #include +#include #define IS_VISIBLE(e) \ (((e.x + status->ScrollX) >= 0 && \ @@ -46,19 +47,25 @@ namespace cgeditor { class MoveTable : public Component { - std::uint32_t UpdateMoves(CGEHalfMove *, std::uint32_t, std::uint32_t,bool only_black); + typedef struct MoveState { + bool IsFolded=false; + bool IsHidden=false; + } MoveState; + std::uint32_t UpdateMoves(CMI::HalfMove *, std::uint32_t, std::uint32_t,bool only_black); std::int32_t CurrentMove; std::vector VariationMargins; + /// @brief Must be kept consistent: + std::unordered_map MovesStates; bool IsMouseOver(const Element &e) const; - std::uint32_t DrawComment(CGEHalfMove *m, std::uint32_t line, std::uint32_t indent, + std::uint32_t DrawComment(CMI::HalfMove *m, std::uint32_t line, std::uint32_t indent, const Element &move_bound, const char &indent_black); - std::uint32_t DrawVariations(CGEHalfMove *m, std::uint32_t line, std::uint32_t indent, + std::uint32_t DrawVariations(CMI::HalfMove *m, std::uint32_t line, std::uint32_t indent, const Element &move_bound, const char &indent_black); - public: MoveTable(Status *s); void Refresh(); std::vector GetVariationsMarging() { return (VariationMargins); } + void SyncCache(); }; } // namespace cgeditor \ No newline at end of file -- cgit v1.2.3