From 088b948122cbf24dd9dc1dfedf4be2724bab2157 Mon Sep 17 00:00:00 2001 From: ymherklotz Date: Mon, 16 Jan 2017 01:12:25 +0000 Subject: backing up files, with parser changes --- include/board_state_parser.hpp | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 include/board_state_parser.hpp (limited to 'include/board_state_parser.hpp') diff --git a/include/board_state_parser.hpp b/include/board_state_parser.hpp new file mode 100644 index 0000000..39286d4 --- /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 +#include +#include + +namespace ymhChessAI { +typedef std::vector 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: + static const unsigned BOARD_SIZE = 64; + + boardStateData boardStateVector; + std::ifstream boardFile; +}; +} + +#endif -- cgit