ChessClock Class Reference

Clock of a individual player. More...

#include <chessclock.h>

Inheritance diagram for ChessClock:
ChessClockWidget

List of all members.

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 TurnInformationendTurn ()
 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.

Detailed Description

Clock of a individual player.

Author:
Arto Hyvättinen
Date:
2010-08-13

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.


Member Enumeration Documentation

Enumerator:
NotRunning 

Not turn.

Running 

Turn running.

Paused 

Turn paused.

Definition at line 50 of file chessclock.h.


Constructor & Destructor Documentation

ChessClock::ChessClock ( bool  white,
QWidget *  parent = 0 
)

Definition at line 28 of file chessclock.cpp.


Member Function Documentation

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.

Returns:
Locked turn information

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.

Returns:
Time available in msecs

Definition at line 100 of file chessclock.cpp.

int ChessClock::getTimePlayed (  )  const [virtual]

Get total time played.

Returns:
Time played in msecs

Definition at line 111 of file chessclock.cpp.

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.

Parameters:
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.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator
Generated on Sat Aug 14 01:28:48 2010 for Chess Clock by  doxygen 1.6.3