kreversigame.h 942 Bytes
Newer Older
1 2 3 4 5
#ifndef KREVERSI_GAME_H
#define KREVERSI_GAME_H

#include <QObject>

6
#include "kreversiboard.h"
7 8 9 10 11 12 13 14 15 16 17

/**
 *  KReversiGame incapsulates all of the game logic.
 *  It creates KReversiBoard and manages a chips on it.
 *  Whenever the board state changes it emits corresponding signals.
 *  FIXME dimsuz: enumerate them briefly
 *  The idea is also to abstract from any graphic representation of the game process
 */
class KReversiGame : public QObject
{
public:
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
18
    KReversiGame();
19 20 21 22 23
    ~KReversiGame();
    /**
     *  @returns the board so the callers can examine its current state
     */
    const KReversiBoard& board() const;
24 25 26
    ChipColor currentPlayer() const { return NoColor;/* FIXME dimsuz: implement */ }
    int playerScore( ChipColor player ) const { return m_board->playerScore( player ); }
    ChipColor chipColorAt( int row, int col ) const { return m_board->chipColorAt( row, col ); }
27 28 29 30
private:
    KReversiBoard *m_board;
};
#endif