File indexing completed on 2024-05-12 08:00:33
0001 /* 0002 * Copyright (C) 2001-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 GOLF_H 0037 #define GOLF_H 0038 0039 // own 0040 #include "dealer.h" 0041 0042 class Golf : public DealerScene 0043 { 0044 Q_OBJECT 0045 0046 public: 0047 explicit Golf(const DealerInfo *di); 0048 void initialize() override; 0049 QString solverFormat() const; 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 restart(const QList<KCard *> &cards) override; 0056 bool drop() override; 0057 0058 protected Q_SLOTS: 0059 bool newCards() override; 0060 0061 private: 0062 PatPile *talon; 0063 PatPile *stack[7]; 0064 PatPile *waste; 0065 0066 friend class GolfSolver; 0067 }; 0068 0069 #endif