aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/Game.hpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-23 18:11:55 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-23 18:11:55 +0100
commitce941c146aea7925bded6b9d2a0d0559d3156ad3 (patch)
tree4c52e02600e3fd127bfb28b3e974d45541ec9e4e /src/game_tab/Game.hpp
Create repository
Diffstat (limited to 'src/game_tab/Game.hpp')
-rw-r--r--src/game_tab/Game.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/game_tab/Game.hpp b/src/game_tab/Game.hpp
new file mode 100644
index 0000000..790d18c
--- /dev/null
+++ b/src/game_tab/Game.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "ChessArbiter.hpp"
+#include "HalfMove.hpp"
+#include "ochess.hpp"
+#include <unordered_map>
+
+class Game {
+ std::string board;
+ std::string initial_fen;
+ std::unordered_map<std::string, std::string> tags;
+ HalfMove *moves;
+ HalfMove *current;
+ chessarbiter::ChessArbiter arbiter;
+
+public:
+ Game();
+ Game(std::string fen);
+ Game(HalfMove *m);
+
+ std::string GetBoard();
+ std::string GetTag(std::string tagname);
+ void SetTag(std::string tagname, std::string value);
+ void DeleteTag(std::string tagname);
+ HalfMove *GetCurrentMove();
+ HalfMove *GetMoves();
+ std::string GetFen();
+ bool Play(std::string move);
+ bool IsBlackToPlay();
+ void Previous();
+ void Next();
+ void DeleteMove(HalfMove *m);
+ void PromoteMove(HalfMove *m);
+ void SetMoveAsMainline(HalfMove *m);
+ void SetCurrent(HalfMove *m);
+ std::vector<std::string> ListTags();
+ std::string GetPGN();
+}; \ No newline at end of file