kanjiMove.h
Go to the documentation of this file.
00001 /* kajiMove.h
00002  */
00003 #ifndef OSL_RECORD_KANJIMOVE_H
00004 #define OSL_RECORD_KANJIMOVE_H
00005 
00006 #include "osl/ptype.h"
00007 #include "osl/square.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       Square toSquare(const std::string&) const;
00042       Ptype toPtype(const std::string&) const;
00043 
00044       static const KanjiMove& instance();
00045     private:
00046       typedef std::list<Move> found_moves_t;
00047       void selectCandidates(found_moves_t& found, 
00048                             std::string& str, 
00049                             const Square& to_pos,
00050                             const Player& player) const;
00051       typedef hash_map<std::string, Square, boost::hash<std::string> >
00052       str2position_t;
00053       str2position_t str2position;
00054       typedef hash_map<std::string, Ptype, boost::hash<std::string> > str2piece_t;
00055       str2piece_t str2piece;
00056       bool verbose;
00057     };
00058   } // record
00059 } // osl
00060 
00061 #endif /* OSL_RECORD_KANJIMOVE_H */
00062 // ;;; Local Variables:
00063 // ;;; mode:c++
00064 // ;;; c-basic-offset:2
00065 // ;;; coding:utf-8
00066 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines