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