File indexing completed on 2022-11-23 10:45:30

0001 /*
0002     SPDX-FileCopyrightText: 2013 Denis Kuplyakov <dener.kup@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KREVERSICOMPUTERPLAYER_H
0008 #define KREVERSICOMPUTERPLAYER_H
0009 
0010 #include "kreversiplayer.h"
0011 
0012 /**
0013  * Represents computer or AI of this game. Implements KReversiPlayer.
0014  *
0015  * @see KReversiPlayer
0016  */
0017 class KReversiComputerPlayer : public KReversiPlayer
0018 {
0019     Q_OBJECT
0020 public:
0021     /**
0022      * Constructs AI player of specified @p color and @p name
0023      */
0024     explicit KReversiComputerPlayer(ChipColor color, const QString &name);
0025     ~KReversiComputerPlayer() override;
0026 
0027     /**
0028      *  Overridden slots from @see KReversiPlayer
0029      */
0030     void prepare(KReversiGame *game) override;
0031     void takeTurn() override;
0032     void skipTurn() override;
0033     void gameOver() override;
0034 
0035     /**
0036      *  Sets computer skill
0037      *  @param skill Skill level from 1 to 7
0038      */
0039     void setSkill(int skill);
0040 
0041     /**
0042      *  @return lowest skill that has been set
0043      */
0044     int lowestSkill();
0045 
0046 Q_SIGNALS:
0047 
0048 public Q_SLOTS:
0049 
0050 private:
0051     int m_lowestSkill;
0052     Engine *m_engine;
0053 };
0054 
0055 #endif // KREVERSICOMPUTERPLAYER_H