Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SpLibertyPlayer.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file SpLibertyPlayer.h
00003     Liberty player, concentrates on low liberty stones */
00004 //----------------------------------------------------------------------------
00005 
00006 #ifndef SP_LIBERTYPLAYER_H
00007 #define SP_LIBERTYPLAYER_H
00008 
00009 #include "SpSimplePlayer.h"
00010 #include "SpMoveGenerator.h"
00011 
00012 //----------------------------------------------------------------------------
00013 
00014 /** Tries to capture and escape with low liberty stones
00015     Blocks with few liberties are very important to this player  */
00016 class SpLibertyMoveGenerator
00017     : public SpStaticMoveGenerator
00018 {
00019 public:
00020     SpLibertyMoveGenerator(const GoBoard& board)
00021         : SpStaticMoveGenerator(board)
00022     { }
00023 
00024     int Score(SgPoint p);
00025 };
00026 
00027 //----------------------------------------------------------------------------
00028 
00029 /** Simple player using SpLibertyMoveGenerator */
00030 class SpLibertyPlayer
00031     : public SpSimplePlayer
00032 {
00033 public:
00034     SpLibertyPlayer(const GoBoard& board)
00035         : SpSimplePlayer(board, new SpLibertyMoveGenerator(board))
00036     { }
00037 
00038     std::string Name() const
00039     {
00040         return "Liberty";
00041     }
00042 };
00043 
00044 //----------------------------------------------------------------------------
00045 
00046 int LibertyMinus2(const GoBoard& board, SgBlackWhite color);
00047 
00048 #endif
00049 


Sun Mar 13 2011 Doxygen 1.7.1