/*! Get total time played
@return Time played in msecs */
- virtual int getTimePlayed() const;
+ virtual int getTimePlayed();
/*! Set time available
@param msecs Time to add in msecs */
void addTime(int msecs);
+ /*! Get time played current turn.
+ @return Time in msecs */
+ int currentTurnPlayed();
+
signals:
void timeOutLoser();
void turnEnded();
+ /*! Emitted after 30 min played one turn.
+
+ Will cause screen not to keeped lit.
+ @since 1.1.2
+ */
+ void dontEatBattery();
public slots:
/*! Update clock information, check looser state and refresh */
virtual void updateClock();
-private:
+protected:
ChessClock* another_; /*! Another player's clock */
bool loser_; /*! Is player losed because of timeout */
int turn_; /*! Current turn */
RunningStatus status_;
TurnInformation* currentTurn_;
+ bool dontEatBatteryEmitted_;
int timePlayedBeforeTurn_; /*! Time played in this game BEFORE this turn msecs */
int timeAvailableBeforeTurn_; /*! Time available for play BEFORE this turn msecs !*/
QTimer updateTimer_;
static const int UPDATEINTERVAL = 1000; /** Clock updating interval in msecs */
-
+ static const int DONTEATBATTERYTIME = 30 * 60 * 1000; /*! Time after screen not to keep lit */
};
#endif // CHESSCLOCK_H