00001 /* kajiMove.h 00002 */ 00003 #ifndef OSL_RECORD_KANJIMOVE_H 00004 #define OSL_RECORD_KANJIMOVE_H 00005 00006 #include "osl/numEffectState.h" 00007 #include <unordered_map> 00008 #include <string> 00009 #include <list> 00010 00011 namespace osl 00012 { 00013 namespace record 00014 { 00019 class KanjiMove 00020 { 00021 public: 00022 KanjiMove(); 00023 ~KanjiMove(); 00024 00028 const Move strToMove(const std::string&, 00029 const NumEffectState& state, 00030 const Move& last_move) const; 00031 void setVerbose(bool verbose) {this->verbose = verbose;} 00032 00033 Square toSquare(const std::string&) const; 00034 Ptype toPtype(const std::string&) const; 00035 00036 static const KanjiMove& instance(); 00037 private: 00038 typedef std::list<Move> found_moves_t; 00039 void selectCandidates(found_moves_t& found, 00040 std::string& str, 00041 const Square& to_pos, 00042 const Player& player) const; 00043 typedef std::unordered_map<std::string, Square> 00044 str2position_t; 00045 str2position_t str2position; 00046 typedef std::unordered_map<std::string, Ptype> str2piece_t; 00047 str2piece_t str2piece; 00048 bool verbose; 00049 }; 00050 } // record 00051 using record::KanjiMove; 00052 } // osl 00053 00054 #endif /* OSL_RECORD_KANJIMOVE_H */ 00055 // ;;; Local Variables: 00056 // ;;; mode:c++ 00057 // ;;; c-basic-offset:2 00058 // ;;; coding:utf-8 00059 // ;;; End: