00001 /* kajiMove.h 00002 */ 00003 #ifndef _KANJIMOVE_H 00004 #define _KANJIMOVE_H 00005 00006 #include "osl/ptype.h" 00007 #include "osl/position.h" 00008 #include "osl/move.h" 00009 #include "osl/stl/hash_map.h" 00010 #include "osl/state/numEffectState.h" 00011 #include <string> 00012 #include <list> 00013 #include <boost/functional/hash.hpp> 00014 00015 namespace osl 00016 { 00017 namespace state 00018 { 00019 class SimpleState; 00020 } 00021 namespace record 00022 { 00027 class KanjiMove 00028 { 00029 public: 00030 KanjiMove(); 00031 ~KanjiMove(); 00032 00036 const Move strToMove(const std::string&, 00037 const NumEffectState& state, 00038 const Move& last_move) const; 00039 void setVerbose(bool verbose) {this->verbose = verbose;} 00040 00041 Position toPosition(const std::string&) const; 00042 Ptype toPtype(const std::string&) const; 00043 private: 00044 typedef std::list<Move> found_moves_t; 00045 void selectCandidates(found_moves_t& found, 00046 std::string& str, 00047 const Position& to_pos, 00048 const Player& player) const; 00049 typedef hash_map<std::string, Position, boost::hash<std::string> > 00050 str2position_t; 00051 str2position_t str2position; 00052 typedef hash_map<std::string, Ptype, boost::hash<std::string> > str2piece_t; 00053 str2piece_t str2piece; 00054 bool verbose; 00055 }; 00056 00057 } // record 00058 } // osl 00059 00060 #endif /* _KANJIMOVE_H */ 00061 // ;;; Local Variables: 00062 // ;;; mode:c++ 00063 // ;;; c-basic-offset:2 00064 // ;;; End: