1 /*
2  * Copyright (C) 2001-2009 Stephan Kulow <coolo@kde.org>
3  *
4  * License of original code:
5  * -------------------------------------------------------------------------
6  *   Permission to use, copy, modify, and distribute this software and its
7  *   documentation for any purpose and without fee is hereby granted,
8  *   provided that the above copyright notice appear in all copies and that
9  *   both that copyright notice and this permission notice appear in
10  *   supporting documentation.
11  *
12  *   This file is provided AS IS with no warranties of any kind.  The author
13  *   shall have no liability with respect to the infringement of copyrights,
14  *   trade secrets or any patents by this file or any part thereof.  In no
15  *   event will the author be liable for any lost revenue or profits or
16  *   other special, indirect and consequential damages.
17  * -------------------------------------------------------------------------
18  *
19  * License of modifications/additions made after 2009-01-01:
20  * -------------------------------------------------------------------------
21  *   This program is free software; you can redistribute it and/or
22  *   modify it under the terms of the GNU General Public License as
23  *   published by the Free Software Foundation; either version 2 of
24  *   the License, or (at your option) any later version.
25  *
26  *   This program is distributed in the hope that it will be useful,
27  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
28  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29  *   GNU General Public License for more details.
30  *
31  *   You should have received a copy of the GNU General Public License
32  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
33  * -------------------------------------------------------------------------
34  */
35 
36 #ifndef GOLF_H
37 #define GOLF_H
38 
39 // own
40 #include "dealer.h"
41 
42 
43 class Golf : public DealerScene
44 {
45     Q_OBJECT
46 
47 public:
48     explicit Golf( const DealerInfo * di );
49     void initialize() override;
50     QString solverFormat() const;
51 
52 protected:
53     void setGameState( const QString & state ) override;
54     bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const override;
55     bool checkRemove(const PatPile * pile, const QList<KCard*> & cards) const override;
56     void restart( const QList<KCard*> & cards ) override;
57     bool drop() override;
58 
59 protected Q_SLOTS:
60     bool newCards() override;
61 
62 private:
63     PatPile* talon;
64     PatPile* stack[7];
65     PatPile* waste;
66 
67     friend class GolfSolver;
68 };
69 
70 #endif
71