Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SpMaxEyePlayer.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file SpMaxEyePlayer.h
00003     Plays to complete simple eyes as quickly as possible, or preventing
00004     opponent from doing so.
00005 */
00006 //----------------------------------------------------------------------------
00007 
00008 #ifndef SP_MAXEYEPLAYER_H
00009 #define SP_MAXEYEPLAYER_H
00010 
00011 //----------------------------------------------------------------------------
00012 
00013 #include "SpSimplePlayer.h"
00014 #include "SpMoveGenerator.h"
00015 
00016 //----------------------------------------------------------------------------
00017 
00018 /** Tries to maximize simple eye score of any point.
00019 */
00020 class SpMaxEyeMoveGenerator
00021     : public Sp1PlyMoveGenerator
00022 {
00023 public:
00024     explicit SpMaxEyeMoveGenerator(GoBoard& board, bool eyego = false)
00025         : Sp1PlyMoveGenerator(board), m_eyeGo(eyego)
00026     { }
00027 
00028     int Evaluate();
00029     
00030     float Heuristic(SgPoint p, SgBlackWhite color);
00031     
00032 private:
00033     bool m_eyeGo;
00034 };
00035 
00036 //----------------------------------------------------------------------------
00037 
00038 /** Simple player using SpMaxEyeMoveGenerator */
00039 class SpMaxEyePlayer
00040     : public SpSimplePlayer
00041 {
00042 public:
00043     SpMaxEyePlayer(GoBoard& board, bool eyego = false)
00044         : SpSimplePlayer(board, new SpMaxEyeMoveGenerator(board, eyego))
00045     { }
00046 
00047     std::string Name() const
00048     {
00049         return "MaxEye";
00050     }    
00051 };
00052 
00053 //----------------------------------------------------------------------------
00054 
00055 #endif // SP_MAXEYEPLAYER_H
00056 


17 Jun 2010 Doxygen 1.4.7