+
+
+int ChessClock::getTimePlayed() const
+{
+ // Count time played time
+ if( currentTurn_ )
+ return timePlayedBeforeTurn_ + currentTurn_->getDuration();
+ else
+ return timePlayedBeforeTurn_;
+}
+
+void ChessClock::updateClock()
+{
+ // Check loser
+ if( another_ && !another_->isLoser())
+ {
+ if( getTimeAvailable() < 0 && !loser_)
+ {
+ loser_ = true;
+ emit timeOutLoser();
+ }
+
+ }
+ repaintClock();
+
+}
+