computerPlayer.cc
Go to the documentation of this file.
00001 /* computerPlayer.cc
00002  */
00003 #include "osl/game_playing/computerPlayer.h"
00004 #include "osl/game_playing/gameState.h"
00005 #include "osl/game_playing/openingBookTracer.h"
00006 #include "osl/move_generator/legalMoves.h"
00007 #include "osl/container/moveVector.h"
00008 #include "osl/misc/random.h"
00009 
00010 osl::game_playing::
00011 ComputerPlayer::~ComputerPlayer()
00012 {
00013 }
00014 
00015 bool osl::game_playing::
00016 ComputerPlayer::isReasonableMove(const GameState&, Move, int)
00017 {
00018   return true;
00019 }
00020 
00021 void osl::game_playing::
00022 ComputerPlayer::allowSpeculativeSearch(bool value)
00023 {
00024   speculative_search_allowed = value;
00025 }
00026 
00027 void osl::game_playing::
00028 ComputerPlayer::setInitialState(const NumEffectState&)
00029 {
00030 }
00031 
00032 bool osl::game_playing::
00033 ComputerPlayer::stopSearchNow()
00034 {
00035   return true;
00036 }
00037 
00038 void osl::game_playing::
00039 ComputerPlayer::setRootIgnoreMoves(const container::MoveVector */*rim*/, bool) 
00040 {
00041 }
00042 
00043 /* ------------------------------------------------------------------------- */
00044 osl::game_playing::
00045 ComputerPlayerSelectBestMoveInTime::~ComputerPlayerSelectBestMoveInTime()
00046 {
00047 }
00048 
00049 /* ------------------------------------------------------------------------- */
00050 
00051 osl::game_playing::
00052 ResignPlayer::~ResignPlayer()
00053 {
00054 }
00055 
00056 void osl::game_playing::
00057 ResignPlayer::pushMove(Move)
00058 {
00059 }
00060 void osl::game_playing::
00061 ResignPlayer::popMove()
00062 {
00063 }
00064 const osl::search::MoveWithComment osl::game_playing::
00065 ResignPlayer::selectBestMove(const GameState&, int, int, int)
00066 {
00067   return MoveWithComment(Move::INVALID());
00068 }
00069 
00070 /* ------------------------------------------------------------------------- */
00071 
00072 osl::game_playing::
00073 RandomPlayer::~RandomPlayer()
00074 {
00075 }
00076 
00077 void osl::game_playing::
00078 RandomPlayer::pushMove(Move)
00079 {
00080 }
00081 void osl::game_playing::
00082 RandomPlayer::popMove()
00083 {
00084 }
00085 const osl::search::MoveWithComment osl::game_playing::
00086 RandomPlayer::selectBestMove(const GameState& state, int, int, int)
00087 {
00088   MoveVector moves;
00089   move_generator::LegalMoves::generate(state.state(), moves);
00090   if (moves.empty())
00091     return MoveWithComment(Move::INVALID());
00092   return MoveWithComment(moves[time_seeded_random() % moves.size()]);
00093 }
00094 
00095 /* ------------------------------------------------------------------------- */
00096 // ;;; Local Variables:
00097 // ;;; mode:c++
00098 // ;;; c-basic-offset:2
00099 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines