File indexing completed on 2024-05-12 04:04:51

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