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

0001 /*
0002  *   Copyright 2021 Michael Lang <criticaltemp@protonmail.com>
0003  *
0004  *   This program is free software; you can redistribute it and/or
0005  *   modify it under the terms of the GNU General Public License as
0006  *   published by the Free Software Foundation; either version 2 of
0007  *   the License, or (at your option) any later version.
0008  *
0009  *   This program is distributed in the hope that it will be useful,
0010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  *   GNU General Public License for more details.
0013  *
0014  *   You should have received a copy of the GNU General Public License
0015  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
0016  */
0017 
0018 #ifndef BAKERSDOZEN_H
0019 #define BAKERSDOZEN_H
0020 
0021 // own
0022 #include "dealer.h"
0023 #include "hint.h"
0024 
0025 class KSelectAction;
0026 
0027 class BakersDozen : public DealerScene
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit BakersDozen(const DealerInfo *di);
0033     void initialize() override;
0034     void mapOldId(int id) override;
0035     int oldId() const override;
0036     QList<QAction *> configActions() const override;
0037 
0038 protected:
0039     bool checkAdd(const PatPile *pile, const QList<KCard *> &oldCards, const QList<KCard *> &newCards) const override;
0040     bool checkRemove(const PatPile *pile, const QList<KCard *> &cards) const override;
0041     void restart(const QList<KCard *> &cards) override;
0042     // QList<MoveHint> getHints() override;
0043 
0044 private Q_SLOTS:
0045     void gameTypeChanged();
0046 
0047 private:
0048     void setOptions(int v);
0049     void getSavedOptions();
0050     void setSavedOptions();
0051     void matchVariant();
0052 
0053     virtual QString solverFormat() const;
0054     PatPile *store[13];
0055     PatPile *target[4];
0056 
0057     KSelectAction *options;
0058     int m_variation;
0059 
0060     KSelectAction *m_emptyStackFillOption;
0061     int m_emptyStackFill;
0062 
0063     KSelectAction *m_stackFacedownOption;
0064     int m_stackFacedown;
0065 
0066     KSelectAction *m_sequenceBuiltByOption;
0067     int m_sequenceBuiltBy;
0068 
0069     friend class BakersDozenSolver;
0070 };
0071 
0072 #endif