00001 //---------------------------------------------------------------------------- 00002 /** @file GoSetupUtil.h 00003 utilities to create setup information for GoBoard. */ 00004 //---------------------------------------------------------------------------- 00005 00006 #ifndef GO_SETUPUTIL_H 00007 #define GO_SETUPUTIL_H 00008 00009 #include <streambuf> 00010 #include "GoBoard.h" 00011 #include "GoSetup.h" 00012 00013 //---------------------------------------------------------------------------- 00014 namespace GoSetupUtil 00015 { 00016 00017 /** Create a setup instance from text stream. 00018 Recognizes '0','o','O' for white stones, 00019 'x', 'X', '@' for black stones, 00020 '.' and '+' for empty points. 00021 Blanks ' ' and tabs are ignored. 00022 Lines must be separated by a '\n' character. */ 00023 GoSetup CreateSetupFromStream(std::streambuf& in, int& boardSize); 00024 00025 GoSetup CreateSetupFromString(std::string& in, int& boardSize); 00026 00027 /** Get a setup instance with the current position on board. */ 00028 GoSetup CurrentPosSetup(const GoBoard& bd); 00029 00030 } // namespace GoSetupUtil 00031 00032 //---------------------------------------------------------------------------- 00033 00034 #endif // GO_SETUPUTIL_H 00035