aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/HalfMove.hpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-01-19 16:33:44 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2023-01-19 16:33:44 +0100
commita1289dec3dcec278f9cf6d18a001b3146b11b7b2 (patch)
tree99fcdcba7f08f57994ec11c4c68c87339dff8ef3 /src/game_tab/HalfMove.hpp
parentaa6ec0ea601ac2a0b11752d210ce67fdb85ee60f (diff)
Integrate CMI
Diffstat (limited to 'src/game_tab/HalfMove.hpp')
-rw-r--r--src/game_tab/HalfMove.hpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/game_tab/HalfMove.hpp b/src/game_tab/HalfMove.hpp
index 297ca50..6637571 100644
--- a/src/game_tab/HalfMove.hpp
+++ b/src/game_tab/HalfMove.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "CGEditor.hpp"
+#include "CMI.hpp"
#include "ChessArbiter.hpp"
#include "ochess.hpp"
#include "pgnp.hpp"
@@ -9,11 +9,7 @@
/**
* @brief This class extends CGEHalfMove (to be displayed in the game editor)
*/
-class HalfMove : public cgeditor::CGEHalfMove {
- HalfMove *parent = nullptr;
- HalfMove *mainline = nullptr;
- chessarbiter::ChessArbiter arbiter;
- std::vector<HalfMove *> variations;
+class HalfMove : public CMI::HalfMove {
std::string fen;
/// @brief Used in to retrieve captured pieces (see GetLineCaptures())
char capture;
@@ -22,35 +18,20 @@ class HalfMove : public cgeditor::CGEHalfMove {
std::string src,dst;
/// @brief Opening reach by that move while taking into account all the parents
std::string opening, eco;
+ chessarbiter::ChessArbiter arbiter;
public:
HalfMove(HalfMove *m);
HalfMove(std::string move_absolute,std::string move_san);
HalfMove(std::string move_absolute,std::string move_san, std::string fen);
- HalfMove(pgnp::HalfMove *m);
+ HalfMove(CMI::HalfMove *m);
- ~HalfMove();
- /// @brief Add variation to current move
- void AddVariation(HalfMove *m);
- /// @brief Remove the specified child from mainline and/or variations
- void RemoveChild(HalfMove *m);
void AddMove(HalfMove *m);
- /// @brief Set value of the mailine
- void SetMainline(HalfMove *m);
- /// @brief Set this move as mainline
- void SetAsMainline();
- /// @brief Promote the current move and submove
- void Promote();
/// @brief Check if current half move is within a variation
bool IsVariation();
/// @brief Get the root of a variation
bool HasParent(HalfMove*m);
bool HasChild(HalfMove*m);
- HalfMove *GetRoot();
- /// @brief Get parent of the current move
- HalfMove *GetParent();
- HalfMove *GetMainline();
- std::vector<HalfMove *> GetVariations();
/// @brief Retrieve the list of moves from the current one to the first one
std::vector<HalfMove *> GetLine();
std::string GetLineAsSAN();
@@ -59,12 +40,9 @@ public:
void SetOpening(const std::string &name, const std::string &eco);
/// @brief Getters for name and eco
void GetOpening(std::string &name, std::string &eco);
- /// @brief Set parent of the current move
- void SetParent(HalfMove *m);
std::string GetFen();
void SetFen(std::string fen);
void SetCapture(char c);
- bool IsABlackMove();
void GetAbsoluteMove(std::string &src,std::string &dst);
void SetAbsoluteMove(const std::string &move_absolute);