File indexing completed on 2022-09-27 13:19:29

0001 /*
0002     SPDX-FileCopyrightText: 2006 Matthew Williams <matt@milliams.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KSQUARESDEMOWINDOW_H
0008 #define KSQUARESDEMOWINDOW_H
0009 
0010 #include <KXmlGuiWindow>
0011 
0012 #include "ksquaresgame.h"
0013 
0014 class GameBoardView;
0015 class GameBoardScene;
0016 
0017 /**
0018  * @short Mainwindow class for demonstration mode
0019  *
0020  * Creates a very simple mainwindow and continuously plays 4 computer players against eachother.
0021  *
0022  * @author Matt Williams <matt@milliams.com>
0023  */
0024 
0025 class KSquaresDemoWindow : public KXmlGuiWindow
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     ///Constructor
0031     KSquaresDemoWindow();
0032 
0033 public Q_SLOTS:
0034     void gameNew();
0035 
0036 private Q_SLOTS:
0037     void aiChooseLine();
0038     void playerTakeTurn(KSquaresPlayer *currentPlayer);
0039     void gameOver(const QVector<KSquaresPlayer> & /*playerList*/);
0040 
0041 private:
0042     ///The game board view
0043     GameBoardView *m_view;
0044     ///The game scene
0045     GameBoardScene *m_scene;
0046     ///The game controller
0047     KSquaresGame *sGame;
0048 };
0049 
0050 #endif // KSQUARESDEMOWINDOW_H