1/*
2 * Copyright (C) 2000-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 FORTYEIGHT_H
37#define FORTYEIGHT_H
38
39#include "dealer.h"
40
41
42class Fortyeight : public DealerScene
43{
44 Q_OBJECT
45
46public:
47 Fortyeight( const DealerInfo * di );
48 virtual void initialize();
49
50protected:
51 virtual void setGameState( const QString & state );
52 virtual QString getGameState() const;
53 virtual bool checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const;
54 virtual bool checkRemove(const PatPile* pile, const QList<KCard*> & cards) const;
55 virtual void cardsDroppedOnPile( const QList<KCard*> & cards, KCardPile * pile );
56 virtual void restart( const QList<KCard*> & cards );
57
58protected slots:
59 virtual bool newCards();
60
61private:
62 bool canPutStore( const KCardPile * pile, const QList<KCard*> &cards ) const;
63
64 PatPile *talon;
65 PatPile *stack[8];
66 PatPile *target[8];
67 PatPile *pile;
68 bool lastdeal;
69
70 friend class FortyeightSolver;
71};
72
73#endif
74