aboutsummaryrefslogtreecommitdiffstats
path: root/include/board_state_parser.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/board_state_parser.hpp')
-rw-r--r--include/board_state_parser.hpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/board_state_parser.hpp b/include/board_state_parser.hpp
new file mode 100644
index 0000000..b054007
--- /dev/null
+++ b/include/board_state_parser.hpp
@@ -0,0 +1,44 @@
+/*
+ *
+ * author: Yann Herklotz
+ * username: ymherklotz
+ * email: ymherklotz@gmail.com
+ * date created: 15/01/17
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Parser that takes in the board state and outputs it into a format that the
+ * Chess Board class can read
+ *
+ */
+
+#ifndef YMH_BOARD_STATE_PARSER_HPP
+#define YMH_BOARD_STATE_PARSER_HPP
+
+#include <string>
+#include <vector>
+#include <fstream>
+
+namespace ymhChessAI {
+class BoardStateParser;
+
+typedef std::vector<std::string> boardStateData;
+
+class BoardStateParser {
+public:
+ BoardStateParser();
+ BoardStateParser(const std::string& boardFileName);
+ ~BoardStateParser();
+
+ void populateBoardState();
+
+ static unsigned stringToInt(const std::string& str);
+ static std::string getStateFromLine(const std::string& str);
+protected:
+private:
+ boardStateData boardStateVector;
+ std::ifstream boardFile;
+};
+}
+
+#endif