Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoGtpTimeSettings Class Reference

#include <GoGtpTimeSettings.h>

List of all members.


Detailed Description

Time settings as used in time_settings standard GTP command.

Definition at line 13 of file GoGtpTimeSettings.h.

Public Member Functions

 GoGtpTimeSettings ()
 Construct time settings with no time limit.
 GoGtpTimeSettings (int mainTime, int byoYomiTime, int byoYomiStones)
 Construct time settings.
bool operator== (const GoGtpTimeSettings &timeSettings) const
int MainTime () const
int ByoYomiTime () const
int ByoYomiStones () const
bool NoTimeLimits () const
 Check if no time limits are used.

Private Attributes

int m_mainTime
 Main time measured in seconds.
int m_byoYomiTime
 Byo yomi time measured in seconds.
int m_byoYomiStones
 Number of stones per byo yomi period.


Constructor & Destructor Documentation

GoGtpTimeSettings::GoGtpTimeSettings (  ) 

Construct time settings with no time limit.

Definition at line 12 of file GoGtpTimeSettings.cpp.

References NoTimeLimits(), and SG_ASSERT.

GoGtpTimeSettings::GoGtpTimeSettings ( int  mainTime,
int  byoYomiTime,
int  byoYomiStones 
)

Construct time settings.

Supports Canadian byo yomi, including absolute time (no byo yomi) as a special case. Setting mainTime=0 means that the engine immediately starts in byo yomi. Setting byoYomiTime means that if the main time is up before the game is over, the engine loses on time. Setting byoYomiTime>0 and byoYomiStones=0 means no time limits.

Parameters:
mainTime Main time measured in seconds.
byoYomiTime Byo yomi time measured in seconds.
byoYomiStones Number of stones per byo yomi period.

Definition at line 20 of file GoGtpTimeSettings.cpp.

References SG_ASSERT.


Member Function Documentation

int GoGtpTimeSettings::ByoYomiStones (  )  const

Definition at line 66 of file GoGtpTimeSettings.h.

References m_byoYomiStones.

Referenced by GoGtpEngine::ApplyTimeSettings().

int GoGtpTimeSettings::ByoYomiTime (  )  const

Definition at line 61 of file GoGtpTimeSettings.h.

References m_byoYomiTime.

Referenced by GoGtpEngine::ApplyTimeSettings().

int GoGtpTimeSettings::MainTime (  )  const

Definition at line 56 of file GoGtpTimeSettings.h.

References m_mainTime.

Referenced by GoGtpEngine::ApplyTimeSettings().

bool GoGtpTimeSettings::NoTimeLimits (  )  const

Check if no time limits are used.

Equivalent to byoYomiTime>0 and byoYomiStones=0.

Definition at line 39 of file GoGtpTimeSettings.cpp.

References m_byoYomiStones, and m_byoYomiTime.

Referenced by GoGtpEngine::ApplyTimeSettings(), GoGtpEngine::CmdKgsTimeSettings(), GoGtpEngine::GenMove(), and GoGtpTimeSettings().

bool GoGtpTimeSettings::operator== ( const GoGtpTimeSettings timeSettings  )  const

Definition at line 31 of file GoGtpTimeSettings.cpp.

References m_byoYomiStones, m_byoYomiTime, and m_mainTime.


Member Data Documentation

int GoGtpTimeSettings::m_byoYomiStones [private]

Number of stones per byo yomi period.

Definition at line 53 of file GoGtpTimeSettings.h.

Referenced by ByoYomiStones(), NoTimeLimits(), and operator==().

int GoGtpTimeSettings::m_byoYomiTime [private]

Byo yomi time measured in seconds.

Definition at line 50 of file GoGtpTimeSettings.h.

Referenced by ByoYomiTime(), NoTimeLimits(), and operator==().

int GoGtpTimeSettings::m_mainTime [private]

Main time measured in seconds.

Definition at line 47 of file GoGtpTimeSettings.h.

Referenced by MainTime(), and operator==().


The documentation for this class was generated from the following files:


17 Jun 2010 Doxygen 1.4.7