Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoTimeControl.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file GoTimeControl.h
00003     Time management.
00004 */
00005 //----------------------------------------------------------------------------
00006 
00007 #ifndef GO_TIMECONTROL_H
00008 #define GO_TIMECONTROL_H
00009 
00010 #include "SgTimeControl.h"
00011 
00012 class GoBoard;
00013 
00014 //----------------------------------------------------------------------------
00015 
00016 /** Default time management for Go.
00017     Implements SgDefaultTimeControl. The remaining number of moves in the game
00018     is estimated by comparing the number of empty points to the expected final
00019     number of empty points (can be tuned with the SetFinalSpace() parameter;
00020     default = 0.75).
00021 */
00022 class GoTimeControl
00023     : public SgDefaultTimeControl
00024 {
00025 public:
00026     GoTimeControl(const GoBoard& bd);
00027 
00028 
00029     /** @name Parameters */
00030     // @{
00031 
00032     /** Set estimated proportion of occupied points at the end of the game.
00033         See class description.
00034     */
00035     float FinalSpace() const;
00036 
00037     /** See FinalSpace() */
00038     void SetFinalSpace(float finalspace);
00039 
00040     // @} // @name Parameters
00041 
00042 
00043     void GetPositionInfo(SgBlackWhite& toPlay, int& movesPlayed,
00044                          int& estimatedRemainingMoves);
00045 
00046 private:
00047     const GoBoard& m_bd;
00048 
00049     /** Estimated proportion of remaining space that will be played out */
00050     float m_finalSpace;
00051 };
00052 
00053 //----------------------------------------------------------------------------
00054 
00055 #endif // GO_TIMECONTROL_H


17 Jun 2010 Doxygen 1.4.7