Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoTimeSettings.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file GoTimeSettings.h
00003     Time settings for a Go game. */
00004 //----------------------------------------------------------------------------
00005 
00006 #ifndef GO_TIMESETTINGS_H
00007 #define GO_TIMESETTINGS_H
00008 
00009 //----------------------------------------------------------------------------
00010 
00011 /** Time settings for a Go game. */
00012 class GoTimeSettings
00013 {
00014 public:
00015     /** Construct time settings with no time limit. */
00016     GoTimeSettings();
00017 
00018     GoTimeSettings(double mainTime);
00019 
00020     /** Construct time settings.
00021         Currently supports Canadian byo yomi, including absolute time (no byo
00022         yomi) as a special case.
00023         @param mainTime Main time measured in seconds.
00024         @param overtime Byo yomi time measured in seconds.
00025         @param overtimeMoves Number of stones per byo yomi period. */
00026     GoTimeSettings(double mainTime, double overtime, int overtimeMoves);
00027 
00028     bool operator==(const GoTimeSettings& timeSettings) const;
00029 
00030     double MainTime() const;
00031 
00032     double Overtime() const;
00033 
00034     int OvertimeMoves() const;
00035 
00036     bool IsUnknown() const;
00037 
00038 private:
00039     /** Main time measured in seconds. */
00040     double m_mainTime;
00041 
00042     /** Byo yomi time measured in seconds. */
00043     double m_overtime;
00044 
00045     /** Number of stones per byo yomi period. */
00046     int m_overtimeMoves;
00047 };
00048 
00049 inline double GoTimeSettings::MainTime() const
00050 {
00051     return m_mainTime;
00052 }
00053 
00054 inline double GoTimeSettings::Overtime() const
00055 {
00056     return m_overtime;
00057 }
00058 
00059 inline int GoTimeSettings::OvertimeMoves() const
00060 {
00061     return m_overtimeMoves;
00062 }
00063 
00064 //----------------------------------------------------------------------------
00065 
00066 #endif // GO_TIMESETTINGS_H
00067 


Sun Mar 13 2011 Doxygen 1.7.1