Clock of a individual player. More...
#include <chessclock.h>
Public Types | |
enum | RunningStatus { NotRunning = 0, Running = 1, Paused = 2 } |
Public Slots | |
virtual void | repaintClock ()=0 |
Refresh clock information. | |
virtual void | updateClock () |
Update clock information, check looser state and refresh. | |
Signals | |
void | timeOutLoser () |
Public Member Functions | |
ChessClock (bool white, QWidget *parent=0) | |
bool | isLoser () const |
int | getTurn () const |
bool | isWhite () const |
RunningStatus | getStatus () const |
virtual void | startTurn () |
Start new turn. | |
virtual TurnInformation * | endTurn () |
End this turn. | |
virtual void | pauseTurn () |
Pause clock. | |
virtual void | continueTurn () |
Continue paused game. | |
void | setAnother (ChessClock *another) |
Set another chess clock for connecting. | |
virtual int | getTimeAvailable () |
Get total time available. | |
virtual int | getTimePlayed () const |
Get total time played. |
Clock of a individual player.
Base class of chess clock.
ChessClock has not GUI itself, but it is subclass of QWidget avoiding polymorphism.
Definition at line 43 of file chessclock.h.
Definition at line 50 of file chessclock.h.
ChessClock::ChessClock | ( | bool | white, | |
QWidget * | parent = 0 | |||
) |
Definition at line 28 of file chessclock.cpp.
void ChessClock::continueTurn | ( | ) | [virtual] |
Continue paused game.
Definition at line 67 of file chessclock.cpp.
TurnInformation * ChessClock::endTurn | ( | ) | [virtual] |
End this turn.
Player has done his move.
Definition at line 77 of file chessclock.cpp.
RunningStatus ChessClock::getStatus | ( | ) | const [inline] |
Definition at line 59 of file chessclock.h.
int ChessClock::getTimeAvailable | ( | ) | [virtual] |
Get total time available.
Time does't contain delays.
Definition at line 100 of file chessclock.cpp.
int ChessClock::getTimePlayed | ( | ) | const [virtual] |
int ChessClock::getTurn | ( | ) | const [inline] |
Definition at line 57 of file chessclock.h.
bool ChessClock::isLoser | ( | ) | const [inline] |
Definition at line 56 of file chessclock.h.
bool ChessClock::isWhite | ( | ) | const [inline] |
Definition at line 58 of file chessclock.h.
void ChessClock::pauseTurn | ( | ) | [virtual] |
Pause clock.
Definition at line 59 of file chessclock.cpp.
virtual void ChessClock::repaintClock | ( | ) | [pure virtual, slot] |
Refresh clock information.
Implemented in ChessClockWidget.
void ChessClock::setAnother | ( | ChessClock * | another | ) |
Set another chess clock for connecting.
another | Clock of opposite player |
Definition at line 95 of file chessclock.cpp.
void ChessClock::startTurn | ( | ) | [virtual] |
Start new turn.
Definition at line 46 of file chessclock.cpp.
void ChessClock::timeOutLoser | ( | ) | [signal] |
void ChessClock::updateClock | ( | ) | [virtual, slot] |
Update clock information, check looser state and refresh.
Definition at line 120 of file chessclock.cpp.