From cb4f5ada5c91629e96f1daecaf85dc92bee5359d Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 1 Mar 2022 15:58:02 +0100 Subject: Move PGN export to the right place --- src/game_tab/HalfMove.cpp | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'src/game_tab/HalfMove.cpp') diff --git a/src/game_tab/HalfMove.cpp b/src/game_tab/HalfMove.cpp index 0aa957e..0472b7c 100644 --- a/src/game_tab/HalfMove.cpp +++ b/src/game_tab/HalfMove.cpp @@ -172,42 +172,9 @@ bool HalfMove::IsVariation() { std::string HalfMove::GetFen() { return (fen); } -std::string HalfMove::GetPGN() { return (GetPGN(IsBlack)); } +std::vector HalfMove::GetVariations() { return (variations); } -std::string HalfMove::GetPGN(bool needDots) { - std::string part; - bool newNeedDots = false; - - if (!IsBlack || needDots) { - part += std::to_string(Number) + "."; - if (needDots) { - part += ".."; - } - } - part += move; - - if (GetNbLineComment() > 0) { - part += " {"; - part += GetComment(); - part += "}"; - newNeedDots = true; - } - - if (variations.size() > 0) { - newNeedDots = true; - for (HalfMove *v : variations) { - part += " ("; - part += v->GetPGN(IsBlack); - part += ")"; - } - } - - if (mainline != NULL) { - part += " " + mainline->GetPGN(!IsBlack && newNeedDots); - } - - return (part); -} +bool HalfMove::IsABlackMove() { return (IsBlack); } void HalfMove::BuildAndVerify(HalfMove *m, std::string fen) { arbiter.Setup(fen); -- cgit v1.2.3