kreversicomputerplayer.h 1.92 KB
Newer Older
Denis Kuplyakov's avatar
Denis Kuplyakov committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*******************************************************************
 *
 * Copyright 2013 Denis Kuplyakov <dener.kup@gmail.com>
 *
 * This file is part of the KDE project "KReversi"
 *
 * KReversi is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * KReversi is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with KReversi; see the file COPYING.  If not, write to
 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 ********************************************************************/

Denis Kuplyakov's avatar
Denis Kuplyakov committed
24 25 26
#ifndef KREVERSICOMPUTERPLAYER_H
#define KREVERSICOMPUTERPLAYER_H

27
#include "kreversiplayer.h"
Denis Kuplyakov's avatar
Denis Kuplyakov committed
28

29 30 31 32 33
/**
 * Represents computer or AI of this game. Implements KReversiPlayer.
 *
 * @see KReversiPlayer
 */
Denis Kuplyakov's avatar
Denis Kuplyakov committed
34 35 36 37
class KReversiComputerPlayer : public KReversiPlayer
{
    Q_OBJECT
public:
38 39 40
    /**
     * Constructs AI player of specified @p color and @p name
     */
Laurent Montel's avatar
Laurent Montel committed
41
    explicit KReversiComputerPlayer(ChipColor color, const QString &name);
Denis Kuplyakov's avatar
Denis Kuplyakov committed
42 43 44
    ~KReversiComputerPlayer();

    /**
45
     *  Overridden slots from @see KReversiPlayer
Denis Kuplyakov's avatar
Denis Kuplyakov committed
46
     */
47 48 49 50
    void prepare(KReversiGame *game) override;
    void takeTurn() override;
    void skipTurn() override;
    void gameOver() override;
Denis Kuplyakov's avatar
Denis Kuplyakov committed
51 52 53 54 55 56 57

    /**
     *  Sets computer skill
     *  @param skill Skill level from 1 to 7
     */
    void setSkill(int skill);

Denis Kuplyakov's avatar
Denis Kuplyakov committed
58 59 60 61 62
    /**
     *  @return lowest skill that has been set
     */
    int lowestSkill();

63
Q_SIGNALS:
Denis Kuplyakov's avatar
Denis Kuplyakov committed
64

65
public Q_SLOTS:
Denis Kuplyakov's avatar
Denis Kuplyakov committed
66 67

private:
68
    int m_lowestSkill;
Denis Kuplyakov's avatar
Denis Kuplyakov committed
69 70 71 72
    Engine *m_engine;
};

#endif // KREVERSICOMPUTERPLAYER_H