Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SpCapturePlayer.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file SpCapturePlayer.h
00003     Simple player that captures whenever possible, otherwise plays randomly
00004 */
00005 //----------------------------------------------------------------------------
00006 
00007 #ifndef SP_CAPTUREPLAYER_H
00008 #define SP_CAPTUREPLAYER_H
00009 
00010 #include "SpSimplePlayer.h"
00011 #include "SpMoveGenerator.h"
00012 
00013 //----------------------------------------------------------------------------
00014 
00015 /** Simple player that captures whenever possible, otherwise plays randomly */
00016 class SpCaptureMoveGenerator
00017     : public Sp1PlyMoveGenerator
00018 {
00019 public:
00020     explicit SpCaptureMoveGenerator(GoBoard& board)
00021         : Sp1PlyMoveGenerator(board)
00022     { }
00023 
00024     int Evaluate();
00025 };
00026 
00027 //----------------------------------------------------------------------------
00028 
00029 /** Simple player using SpCaptureMoveGenerator */
00030 class SpCapturePlayer
00031     : public SpSimplePlayer
00032 {
00033 public:
00034     SpCapturePlayer(GoBoard& board)
00035         : SpSimplePlayer(board, new SpCaptureMoveGenerator(board))
00036     { }
00037 
00038     std::string Name() const
00039     {
00040         return "Capture";
00041     }
00042 };
00043 
00044 //----------------------------------------------------------------------------
00045 
00046 #endif // SP_CAPTUREPLAYER_H
00047 


17 Jun 2010 Doxygen 1.4.7