kanjiMove.h
Go to the documentation of this file.
/* kajiMove.h
*/
#ifndef OSL_RECORD_KANJIMOVE_H
#define OSL_RECORD_KANJIMOVE_H
#include "osl/numEffectState.h"
#include <unordered_map>
#include <string>
#include <list>
namespace osl
{
namespace record
{
class KanjiMove
{
public:
KanjiMove();
~KanjiMove();
const Move strToMove(const std::string&,
const NumEffectState& state,
const Move& last_move) const;
void setVerbose(bool verbose) {this->verbose = verbose;}
Square toSquare(const std::string&) const;
Ptype toPtype(const std::string&) const;
static const KanjiMove& instance();
private:
typedef std::list<Move> found_moves_t;
void selectCandidates(found_moves_t& found,
std::string& str,
const Square& to_pos,
const Player& player) const;
typedef std::unordered_map<std::string, Square>
str2position_t;
str2position_t str2position;
typedef std::unordered_map<std::string, Ptype> str2piece_t;
str2piece_t str2piece;
bool verbose;
};
} // record
using record::KanjiMove;
} // osl
#endif /* OSL_RECORD_KANJIMOVE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; coding:utf-8
// ;;; End:
osl::KanjiMove::KanjiMove
KanjiMove()
Definition kanjiMove.cc:219
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::Square
Definition basic_type.h:532
osl::record::KanjiMove
Parse kanji records such as "７六歩", the style of which is generally used to write Shogi records in Jap...
Definition kanjiMove.h:20
osl::record::KanjiMove::KanjiMove
KanjiMove()
Definition kanjiMove.cc:219
osl::record::KanjiMove::verbose
bool verbose
Definition kanjiMove.h:48
osl::record::KanjiMove::str2position
str2position_t str2position
Definition kanjiMove.h:45
osl::record::KanjiMove::strToMove
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
osl::record::KanjiMove::str2position_t
std::unordered_map< std::string, Square > str2position_t
Definition kanjiMove.h:44
osl::record::KanjiMove::str2piece_t
std::unordered_map< std::string, Ptype > str2piece_t
Definition kanjiMove.h:46
osl::record::KanjiMove::instance
static const KanjiMove & instance()
Definition kanjiMove.cc:493
osl::record::KanjiMove::toSquare
Square toSquare(const std::string &) const
Definition kanjiMove.cc:260
osl::record::KanjiMove::str2piece
str2piece_t str2piece
Definition kanjiMove.h:47
osl::record::KanjiMove::found_moves_t
std::list< Move > found_moves_t
Definition kanjiMove.h:38
osl::record::KanjiMove::~KanjiMove
~KanjiMove()
Definition kanjiMove.cc:255
osl::record::KanjiMove::toPtype
Ptype toPtype(const std::string &) const
Definition kanjiMove.cc:269
osl::record::KanjiMove::setVerbose
void setVerbose(bool verbose)
Definition kanjiMove.h:31
osl::record::KanjiMove::selectCandidates
void selectCandidates(found_moves_t &found, std::string &str, const Square &to_pos, const Player &player) const
Definition kanjiMove.cc:278
osl::record
棋譜関係
Definition checkDuplicate.h:15
osl
Definition additionalEffect.h:6
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::Player
Player
Definition basic_type.h:8
numEffectState.h