diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-19 13:06:36 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-19 13:06:36 +0100 |
| commit | a84b210ca397194ad360175cf89451f319121e6c (patch) | |
| tree | f44e9396fd5bf0abfd731d5bf897811e95384c32 /src/components/MoveTable.hpp | |
| parent | 5e18d43a6ba4fd378178418de6b2ca7a67d64c21 (diff) | |
Integrate CMI
Diffstat (limited to 'src/components/MoveTable.hpp')
| -rw-r--r-- | src/components/MoveTable.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
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 <cmath> +#include <unordered_map> #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<Element> VariationMargins; + /// @brief Must be kept consistent: + std::unordered_map<CMI::HalfMove*,MoveState> 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<Element> GetVariationsMarging() { return (VariationMargins); } + void SyncCache(); }; } // namespace cgeditor
\ No newline at end of file |
