Commit 847640d9 authored by Denis Kuplyakov's avatar Denis Kuplyakov
Browse files

Documented KReversiPlayer interface

parent b8d834f6
...@@ -29,16 +29,29 @@ ...@@ -29,16 +29,29 @@
class KReversiGame; class KReversiGame;
/**
* Indicates current state of the player
*/
enum KReversiPlayerState { enum KReversiPlayerState {
/** Player is waiting for his move or smth else */
WAITING, WAITING,
/** Player is thinking about his move */
THINKING, THINKING,
/** Player state is unknown */
UNKNOWN UNKNOWN
}; };
/**
* Represents abstract player. It is interface.
*/
class KReversiPlayer: public QObject class KReversiPlayer: public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
/**
* Construct player with specified @p color and @p name.
* @param hintAllowed determines whether hints are allowed for player
* @param undoAllowed determines whether undos are allowed for player
*/
explicit KReversiPlayer(ChipColor color, QString name, explicit KReversiPlayer(ChipColor color, QString name,
bool hintAllowed, bool undoAllowed); bool hintAllowed, bool undoAllowed);
...@@ -85,8 +98,10 @@ public: ...@@ -85,8 +98,10 @@ public:
int getUndoCount(); int getUndoCount();
public slots: public slots:
//TODO: do this with overriding to not bother user of assigning game
/** /**
* Triggered by KReversiGame before game starts * Triggered by KReversiGame before game starts
* Implementation should assign @p game to m_game
*/ */
virtual void prepare(KReversiGame* game) = 0; virtual void prepare(KReversiGame* game) = 0;
...@@ -120,7 +135,7 @@ signals: ...@@ -120,7 +135,7 @@ signals:
protected: protected:
/** /**
* Game player is playing * Game which player is playing
*/ */
KReversiGame *m_game; KReversiGame *m_game;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment