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

0001 /*
0002  *  Copyright (C) 2010 Parker Coates <coates@kde.org>
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 
0019 #ifndef PATPILE_H
0020 #define PATPILE_H
0021 
0022 // KCardGame
0023 #include <KCardPile>
0024 
0025 class DealerScene;
0026 
0027 class PatPile : public KCardPile
0028 {
0029 public:
0030     enum PileRole {
0031         NoRole,
0032         Stock,
0033         Waste,
0034         Tableau,
0035         TableauType1 = Tableau,
0036         TableauType2,
0037         TableauType3,
0038         TableauType4,
0039         Foundation,
0040         FoundationType1 = Foundation,
0041         FoundationType2,
0042         FoundationType3,
0043         FoundationType4,
0044         Cell
0045     };
0046 
0047     PatPile(DealerScene *scene, int index, const QString &objectName = QString());
0048     virtual ~PatPile();
0049 
0050     int index() const;
0051 
0052     void setPileRole(PileRole role);
0053     PileRole pileRole() const;
0054     bool isFoundation() const;
0055 
0056     QList<QPointF> cardPositions() const override;
0057 
0058 protected:
0059     void paintGraphic(QPainter *painter, qreal highlightedness) override;
0060 
0061 private:
0062     int m_index;
0063     PileRole m_role;
0064 };
0065 
0066 #endif