diff options
author | ymherklotz <ymherklotz@gmail.com> | 2017-01-16 01:12:25 +0000 |
---|---|---|
committer | ymherklotz <ymherklotz@gmail.com> | 2017-01-16 01:12:25 +0000 |
commit | 088b948122cbf24dd9dc1dfedf4be2724bab2157 (patch) | |
tree | 4a9610f9ad3e3afbb98510478bd3e2969baad136 /include/board_state_parser.hpp | |
parent | 1f138d96ab7f517e7842710ef3428f67a2965877 (diff) | |
download | ChessAI-088b948122cbf24dd9dc1dfedf4be2724bab2157.tar.gz ChessAI-088b948122cbf24dd9dc1dfedf4be2724bab2157.zip |
backing up files, with parser changes
Diffstat (limited to 'include/board_state_parser.hpp')
-rw-r--r-- | include/board_state_parser.hpp | 44 |
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..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 <string> +#include <vector> +#include <fstream> + +namespace ymhChessAI { +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: + static const unsigned BOARD_SIZE = 64; + + boardStateData boardStateVector; + std::ifstream boardFile; +}; +} + +#endif |