00001 /* usi.h 00002 */ 00003 #ifndef OSL_USI_H 00004 #define OSL_USI_H 00005 00006 #include "osl/numEffectState.h" 00007 #include <vector> 00008 #include <string> 00009 #include <stdexcept> 00010 00011 namespace osl 00012 { 00013 namespace usi 00014 { 00015 const Move strToMove(const std::string&, const NumEffectState&); 00016 PtypeO charToPtypeO(char); 00017 00018 const std::string show(Move); 00019 const std::string show(PtypeO); 00020 const std::string show(Piece); 00021 const std::string show(const NumEffectState&); 00022 00023 class ParseError : public std::invalid_argument 00024 { 00025 public: 00026 ParseError(const std::string& msg = "") 00027 : invalid_argument(msg) 00028 { } 00029 }; 00030 00037 void parseBoard(const std::string& board, NumEffectState&); 00039 void parse(const std::string& line, NumEffectState&); 00040 void parse(const std::string& line, NumEffectState& initial, std::vector<Move>& moves); 00041 00042 NumEffectState makeState(const std::string& line); 00043 } 00044 00049 namespace psn 00050 { 00051 class ParseError : public std::invalid_argument 00052 { 00053 public: 00054 ParseError(const std::string& msg = "") 00055 : invalid_argument(msg) 00056 { } 00057 }; 00058 const Move strToMove(const std::string&, const SimpleState&); 00059 const Square strToPos(const std::string&); 00060 Ptype charToPtype(char); 00061 00062 const std::string show(Move); 00063 const std::string show(Square); 00064 char show(Ptype); 00065 00067 const std::string showXP(Move); 00068 } 00069 } // osl 00070 00071 #endif /* OSL_USI_H */ 00072 // ;;; Local Variables: 00073 // ;;; mode:c++ 00074 // ;;; c-basic-offset:2 00075 // ;;; End: