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 #ifndef SP_MAXEYEPLAYER_H
00008 #define SP_MAXEYEPLAYER_H
00009 
00010 //----------------------------------------------------------------------------
00011 
00012 #include "SpSimplePlayer.h"
00013 #include "SpMoveGenerator.h"
00014 
00015 //----------------------------------------------------------------------------
00016 
00017 /** Tries to maximize simple eye score of any point. */
00018 class SpMaxEyeMoveGenerator
00019     : public Sp1PlyMoveGenerator
00020 {
00021 public:
00022     SpMaxEyeMoveGenerator(const GoBoard& board, bool eyego = false)
00023         : Sp1PlyMoveGenerator(board), m_eyeGo(eyego)
00024     { }
00025 
00026     int Evaluate();
00027     
00028     float Heuristic(SgPoint p, SgBlackWhite color);
00029     
00030 private:
00031     bool m_eyeGo;
00032 };
00033 
00034 //----------------------------------------------------------------------------
00035 
00036 /** Simple player using SpMaxEyeMoveGenerator */
00037 class SpMaxEyePlayer
00038     : public SpSimplePlayer
00039 {
00040 public:
00041     SpMaxEyePlayer(const GoBoard& board, bool eyego = false)
00042         : SpSimplePlayer(board, new SpMaxEyeMoveGenerator(board, eyego))
00043     { }
00044 
00045     std::string Name() const
00046     {
00047         return "MaxEye";
00048     }    
00049 };
00050 
00051 //----------------------------------------------------------------------------
00052 
00053 #endif // SP_MAXEYEPLAYER_H
00054 


Sun Mar 13 2011 Doxygen 1.7.1