aboutsummaryrefslogtreecommitdiff
path: root/examples/wxWidgets/MyHalfMove.hpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-02-12 19:13:34 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-02-12 19:13:34 +0100
commita359219e33fdf3afb5ddfbb084563054a947b106 (patch)
tree91dab9c21321f73152993183cd6e8cf4a04017f8 /examples/wxWidgets/MyHalfMove.hpp
Create project
Diffstat (limited to 'examples/wxWidgets/MyHalfMove.hpp')
-rw-r--r--examples/wxWidgets/MyHalfMove.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/wxWidgets/MyHalfMove.hpp b/examples/wxWidgets/MyHalfMove.hpp
new file mode 100644
index 0000000..dfb8860
--- /dev/null
+++ b/examples/wxWidgets/MyHalfMove.hpp
@@ -0,0 +1,40 @@
+#include "CGEditor.hpp"
+#include <vector>
+
+/**
+ * @brief Create your custom half move class
+ *
+ * The implementation of the class should give you
+ * an overview of how to keep your move sync with the one of CGEditor
+ *
+ */
+class MyHalfMove : public cgeditor::CGEHalfMove {
+ MyHalfMove *parent = NULL;
+ MyHalfMove *mainline = NULL;
+ std::vector<MyHalfMove *> variations;
+
+public:
+ MyHalfMove(std::string move);
+ ~MyHalfMove();
+ /// @brief Add variation to current move
+ void AddVariation(MyHalfMove *m);
+ /// @brief Remove the specified child from mainline and/or variations
+ void RemoveChild(MyHalfMove *m);
+ /// @brief Set value of the mailine
+ void SetMainline(MyHalfMove *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
+ MyHalfMove* GetRoot();
+ /// @brief Get parent of the current move
+ MyHalfMove* GetParent();
+ /// @brief Set parent of the current move
+ void SetParent(MyHalfMove *m);
+};
+
+/// @brief Build the example game to use in the editor
+MyHalfMove *BuildExampleGame(); \ No newline at end of file