File indexing completed on 2024-05-12 08:00:35

0001 /*
0002  * Copyright (C) 1997 Rodolfo Borges <barrett@labma.ufrj.br>
0003  * Copyright (C) 1998-2009 Stephan Kulow <coolo@kde.org>
0004  *
0005  * License of original code:
0006  * -------------------------------------------------------------------------
0007  *   Permission to use, copy, modify, and distribute this software and its
0008  *   documentation for any purpose and without fee is hereby granted,
0009  *   provided that the above copyright notice appear in all copies and that
0010  *   both that copyright notice and this permission notice appear in
0011  *   supporting documentation.
0012  *
0013  *   This file is provided AS IS with no warranties of any kind.  The author
0014  *   shall have no liability with respect to the infringement of copyrights,
0015  *   trade secrets or any patents by this file or any part thereof.  In no
0016  *   event will the author be liable for any lost revenue or profits or
0017  *   other special, indirect and consequential damages.
0018  * -------------------------------------------------------------------------
0019  *
0020  * License of modifications/additions made after 2009-01-01:
0021  * -------------------------------------------------------------------------
0022  *   This program is free software; you can redistribute it and/or
0023  *   modify it under the terms of the GNU General Public License as
0024  *   published by the Free Software Foundation; either version 2 of
0025  *   the License, or (at your option) any later version.
0026  *
0027  *   This program is distributed in the hope that it will be useful,
0028  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
0029  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0030  *   GNU General Public License for more details.
0031  *
0032  *   You should have received a copy of the GNU General Public License
0033  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
0034  * -------------------------------------------------------------------------
0035  */
0036 
0037 #ifndef MOD3_H
0038 #define MOD3_H
0039 
0040 // own
0041 #include "dealer.h"
0042 
0043 class Mod3 : public DealerScene
0044 {
0045     Q_OBJECT
0046 
0047 public:
0048     explicit Mod3(const DealerInfo *di);
0049     void initialize() override;
0050 
0051 protected:
0052     void setGameState(const QString &state) override;
0053     bool checkAdd(const PatPile *pile, const QList<KCard *> &oldCards, const QList<KCard *> &newCards) const override;
0054     bool checkRemove(const PatPile *pile, const QList<KCard *> &cards) const override;
0055     void cardsMoved(const QList<KCard *> &cards, KCardPile *oldPile, KCardPile *newPile) override;
0056     void restart(const QList<KCard *> &cards) override;
0057 
0058 protected Q_SLOTS:
0059     bool newCards() override;
0060 
0061 private:
0062     PatPile *talon;
0063     PatPile *stack[4][8];
0064     PatPile *aces;
0065 
0066     friend class Mod3Solver;
0067 };
0068 
0069 #endif