00001 //---------------------------------------------------------------------------- 00002 /** @file GoTimeSettings.cpp 00003 See GoTimeSettings.h */ 00004 //---------------------------------------------------------------------------- 00005 00006 #include "SgSystem.h" 00007 #include "GoTimeSettings.h" 00008 00009 //---------------------------------------------------------------------------- 00010 00011 GoTimeSettings::GoTimeSettings() 00012 : m_mainTime(0), 00013 m_overtime(1), 00014 m_overtimeMoves(0) 00015 { 00016 SG_ASSERT(IsUnknown()); 00017 } 00018 00019 GoTimeSettings::GoTimeSettings(double mainTime) 00020 : m_mainTime(mainTime), 00021 m_overtime(0) 00022 { 00023 } 00024 00025 GoTimeSettings::GoTimeSettings(double mainTime, double overtime, 00026 int overtimeMoves) 00027 : m_mainTime(mainTime), 00028 m_overtime(overtime), 00029 m_overtimeMoves(overtimeMoves) 00030 { 00031 SG_ASSERT(mainTime >= 0); 00032 SG_ASSERT(overtime >= 0); 00033 SG_ASSERT(overtimeMoves >= 0); 00034 } 00035 00036 bool GoTimeSettings::operator==(const GoTimeSettings& timeSettings) 00037 const 00038 { 00039 return (timeSettings.m_mainTime == m_mainTime 00040 && timeSettings.m_overtime == m_overtime 00041 && timeSettings.m_overtimeMoves == m_overtimeMoves); 00042 } 00043 00044 bool GoTimeSettings::IsUnknown() const 00045 { 00046 return (m_overtime > 0 && m_overtimeMoves == 0); 00047 } 00048 00049 //---------------------------------------------------------------------------- 00050 00051