kanjiMove.h
Go to the documentation of this file.
1 /* kajiMove.h
2  */
3 #ifndef OSL_RECORD_KANJIMOVE_H
4 #define OSL_RECORD_KANJIMOVE_H
5 
6 #include "osl/numEffectState.h"
7 #include <unordered_map>
8 #include <string>
9 #include <list>
10 
11 namespace osl
12 {
13  namespace record
14  {
19  class KanjiMove
20  {
21  public:
22  KanjiMove();
23  ~KanjiMove();
24 
28  const Move strToMove(const std::string&,
29  const NumEffectState& state,
30  const Move& last_move) const;
31  void setVerbose(bool verbose) {this->verbose = verbose;}
32 
33  Square toSquare(const std::string&) const;
34  Ptype toPtype(const std::string&) const;
35 
36  static const KanjiMove& instance();
37  private:
38  typedef std::list<Move> found_moves_t;
39  void selectCandidates(found_moves_t& found,
40  std::string& str,
41  const Square& to_pos,
42  const Player& player) const;
43  typedef std::unordered_map<std::string, Square>
46  typedef std::unordered_map<std::string, Ptype> str2piece_t;
47  str2piece_t str2piece;
48  bool verbose;
49  };
50  } // record
51  using record::KanjiMove;
52 } // osl
53 
54 #endif /* OSL_RECORD_KANJIMOVE_H */
55 // ;;; Local Variables:
56 // ;;; mode:c++
57 // ;;; c-basic-offset:2
58 // ;;; coding:utf-8
59 // ;;; End:
Square toSquare(const std::string &) const
Definition: kanjiMove.cc:260
static const KanjiMove & instance()
Definition: kanjiMove.cc:493
void setVerbose(bool verbose)
Definition: kanjiMove.h:31
const Move strToMove(const std::string &, const NumEffectState &state, const Move &last_move) const
Convert a Japanese string (one token) to a move object.
Definition: kanjiMove.cc:361
str2position_t str2position
Definition: kanjiMove.h:45
Ptype
駒の種類を4ビットでコード化する
Definition: basic_type.h:83
std::list< Move > found_moves_t
Definition: kanjiMove.h:38
圧縮していない moveの表現 .
Definition: basic_type.h:1051
利きを持つ局面
Parse kanji records such as "7六歩", the style of which is generally used to write Shogi records in ...
Definition: kanjiMove.h:19
Player
Definition: basic_type.h:8
Ptype toPtype(const std::string &) const
Definition: kanjiMove.cc:269
std::unordered_map< std::string, Square > str2position_t
Definition: kanjiMove.h:44
std::unordered_map< std::string, Ptype > str2piece_t
Definition: kanjiMove.h:46
void selectCandidates(found_moves_t &found, std::string &str, const Square &to_pos, const Player &player) const
Definition: kanjiMove.cc:278
str2piece_t str2piece
Definition: kanjiMove.h:47