00001 //---------------------------------------------------------------------------- 00002 /** @file BookCheck.cpp 00003 */ 00004 //---------------------------------------------------------------------------- 00005 00006 #include "BookCheck.hpp" 00007 00008 using namespace benzene; 00009 00010 //---------------------------------------------------------------------------- 00011 00012 BookCheck::BookCheck(boost::scoped_ptr<Book>& book) 00013 : m_book(book), 00014 m_minCount(1), 00015 m_countWeight(0.02) 00016 { 00017 } 00018 00019 BookCheck::~BookCheck() 00020 { 00021 } 00022 00023 HexPoint BookCheck::BestMove(const HexState& state) 00024 { 00025 if (m_book.get() == 0) 00026 return INVALID_POINT; 00027 HexPoint bookMove = BookUtil::BestMove(*m_book, state, m_minCount, 00028 m_countWeight); 00029 if (bookMove != INVALID_POINT) 00030 LogInfo() << "BookCheck: playing move " << bookMove << '\n'; 00031 return bookMove; 00032 } 00033 00034 //----------------------------------------------------------------------------