#include <gameState.h>
Classes | |
struct | State |
Public Types | |
enum | MoveType { VALID, PAWN_DROP_FOUL, UNSAFE_KING, OTHER_INVALID } |
Public Member Functions | |
GameState (const SimpleState &initial_state) | |
~GameState () | |
MoveType | isIllegal (Move m) const |
const Sennichite | pushMove (Move m, int eval=0) |
const Move | popMove () |
bool | canPopMove () const |
const NumEffectState & | state () const |
const RepetitionCounter & | counter () const |
const container::MoveStack & | moveHistory () const |
const hash::HashKeyStack & | hashHistory () const |
int | moves () const |
int | chessMoves () const |
const SimpleState & | getInitialState () const |
const boost::shared_ptr < GameState > | clone () const |
GameState のコピーを作る. 現在の局面を初期局面として扱うため, pushMoveしない限りpopMoveはできない | |
const vector< int > & | evalStack () const |
void | generateNotLosingMoves (container::MoveVector &normal_or_win_or_draw, container::MoveVector &loss) const |
void | generateMoves (container::MoveVector &normal_moves, container::MoveVector &win, container::MoveVector &draw, container::MoveVector &loss) const |
Private Member Functions | |
GameState (const State &src) | |
Private Attributes | |
boost::scoped_ptr< State > | stack |
State と千日手状態などを一元管理
Definition at line 32 of file gameState.h.
Definition at line 42 of file gameState.h.
osl::game_playing::GameState::GameState | ( | const State & | src | ) | [explicit, private] |
Definition at line 43 of file gameState.cc.
Referenced by clone().
osl::game_playing::GameState::GameState | ( | const SimpleState & | initial_state | ) | [explicit] |
Definition at line 37 of file gameState.cc.
Definition at line 49 of file gameState.cc.
bool osl::game_playing::GameState::canPopMove | ( | ) | const |
int osl::game_playing::GameState::chessMoves | ( | ) | const [inline] |
Definition at line 53 of file gameState.h.
References moves().
const boost::shared_ptr< osl::game_playing::GameState > osl::game_playing::GameState::clone | ( | ) | const |
GameState のコピーを作る. 現在の局面を初期局面として扱うため, pushMoveしない限りpopMoveはできない
Definition at line 134 of file gameState.cc.
References GameState(), result, and stack.
Referenced by osl::game_playing::SpeculativeSearchPlayer::selectBestMoveCleanUp(), and osl::game_playing::SpeculativeAllMoves::SearchAllMoves::setUp().
const osl::RepetitionCounter & osl::game_playing::GameState::counter | ( | ) | const |
Definition at line 122 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), and osl::game_playing::SearchPlayer::setUpTable().
const osl::vector< int > & osl::game_playing::GameState::evalStack | ( | ) | const |
Definition at line 147 of file gameState.cc.
References stack.
void osl::game_playing::GameState::generateMoves | ( | container::MoveVector & | normal_moves, |
container::MoveVector & | win, | ||
container::MoveVector & | draw, | ||
container::MoveVector & | loss | ||
) | const |
Definition at line 153 of file gameState.cc.
References osl::alt(), osl::game_playing::GameState::State::counter, osl::move_generator::capture::generate(), osl::checkmate::ImmediateCheckmate::hasCheckmateMove(), osl::Sennichite::hasWinner(), isIllegal(), osl::Sennichite::isNormal(), osl::RepetitionCounter::isSennichite(), result, osl::game_playing::GameState::State::state, VALID, and osl::Sennichite::winner().
Referenced by generateNotLosingMoves().
void osl::game_playing::GameState::generateNotLosingMoves | ( | container::MoveVector & | normal_or_win_or_draw, |
container::MoveVector & | loss | ||
) | const |
Definition at line 193 of file gameState.cc.
References generateMoves().
Referenced by osl::game_playing::UsiResponse::generateGoodMoves(), and run().
const osl::state::SimpleState & osl::game_playing::GameState::getInitialState | ( | ) | const |
Definition at line 141 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::setPV().
const osl::hash::HashKeyStack & osl::game_playing::GameState::hashHistory | ( | ) | const |
Definition at line 116 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), and osl::game_playing::SpeculativeSearchPlayer::selectBestMove().
Definition at line 66 of file gameState.cc.
References osl::alt(), OTHER_INVALID, PAWN_DROP_FOUL, stack, osl::game_playing::GameState::State::state, UNSAFE_KING, and VALID.
Referenced by generateMoves(), and osl::game_playing::BookPlayer::moveByBook().
const osl::MoveStack & osl::game_playing::GameState::moveHistory | ( | ) | const |
Definition at line 110 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), osl::game_playing::UsiResponse::genmoveProbability(), osl::game_playing::SearchPlayer::saveSearchResult(), osl::game_playing::SearchPlayer::search(), osl::game_playing::SearchPlayer::secondsForThisMove(), osl::game_playing::SpeculativeSearchPlayer::selectBestMove(), osl::game_playing::HistoryToTable::setPV(), and osl::game_playing::SearchPlayer::setUpTable().
int osl::game_playing::GameState::moves | ( | ) | const |
Definition at line 86 of file gameState.cc.
References canPopMove(), result, and stack.
const osl::Sennichite osl::game_playing::GameState::pushMove | ( | Move | m, |
int | eval = 0 |
||
) |
Definition at line 54 of file gameState.cc.
References result, stack, and osl::game_playing::GameState::State::state.
Referenced by osl::game_playing::UsiResponse::generateGoodMoves(), osl::game_playing::UsiResponse::genmoveProbability(), main(), and run().
const osl::NumEffectState & osl::game_playing::GameState::state | ( | ) | const |
Definition at line 98 of file gameState.cc.
References stack.
Referenced by osl::game_playing::HistoryToTable::adjustTable(), osl::game_playing::UsiResponse::genmoveProbability(), osl::game_playing::AlphaBeta2ProgressEvalPlayer::isReasonableMove(), osl::game_playing::AlphaBeta2OpenMidEndingEvalPlayer::isReasonableMove(), osl::game_playing::AlphaBeta3OpenMidEndingEvalPlayer::isReasonableMove(), main(), run(), search(), osl::game_playing::SearchPlayer::search(), osl::game_playing::AlphaBeta2ProgressEvalPlayer::searchWithSecondsForThisMove(), osl::game_playing::AlphaBeta2OpenMidEndingEvalPlayer::searchWithSecondsForThisMove(), osl::game_playing::AlphaBeta3OpenMidEndingEvalPlayer::searchWithSecondsForThisMove(), osl::game_playing::SearchPlayer::secondsForThisMove(), osl::game_playing::RandomPlayer::selectBestMove(), osl::game_playing::SearchPlayer::selectBestMoveInTime(), osl::game_playing::HistoryToTable::setPV(), and osl::game_playing::SearchPlayer::setUpTable().
boost::scoped_ptr<State> osl::game_playing::GameState::stack [private] |
Definition at line 35 of file gameState.h.
Referenced by canPopMove(), clone(), counter(), evalStack(), getInitialState(), hashHistory(), isIllegal(), moveHistory(), moves(), popMove(), pushMove(), and state().