~ubuntu-branches/ubuntu/natty/kdegames/natty-proposed

« back to all changes in this revision

Viewing changes to kpat/libkcardgame/kstandardcarddeck.h

  • Committer: Bazaar Package Importer
  • Author(s): Rohan Garg
  • Date: 2010-05-28 20:16:42 UTC
  • mfrom: (1.2.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20100528201642-vh75rp06hh5hjt6l
Tags: 4:4.4.80-0ubuntu1
* New upstream beta release
* New package for kajongg in debian/control
* Custom deb flag for kajongg in debian/rules
* New install file for kajongg
* Remove README.source from debian/
* Bump dep on kde-sc-dev-latest to 4.4.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2010 Parker Coates <parker.coates@kdemail.org>
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or
 
5
 *  modify it under the terms of the GNU General Public License as
 
6
 *  published by the Free Software Foundation; either version 2 of 
 
7
 *  the License, or (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 */
 
18
 
 
19
#ifndef KSTANDARDCARDDECK_H
 
20
#define KSTANDARDCARDDECK_H
 
21
 
 
22
#include "kabstractcarddeck.h"
 
23
#include "libkcardgame_export.h"
 
24
 
 
25
 
 
26
class LIBKCARDGAME_EXPORT KStandardCardDeck : public KAbstractCardDeck
 
27
{
 
28
public:
 
29
    enum Suit
 
30
    {
 
31
        NoSuit = -1,
 
32
        Clubs = 0,
 
33
        Diamonds = 1,
 
34
        Hearts = 2,
 
35
        Spades = 3
 
36
    };
 
37
 
 
38
    enum Rank
 
39
    {
 
40
        NoRank = 0,
 
41
        Ace = 1,
 
42
        Two,
 
43
        Three,
 
44
        Four,
 
45
        Five,
 
46
        Six,
 
47
        Seven,
 
48
        Eight,
 
49
        Nine,
 
50
        Ten,
 
51
        Jack,
 
52
        Queen,
 
53
        King
 
54
    };
 
55
 
 
56
    static QList<Suit> standardSuits();
 
57
    static QList<Rank> standardRanks();
 
58
 
 
59
    explicit KStandardCardDeck( const KCardTheme & theme = KCardTheme(), QObject * parent = 0 );
 
60
    virtual ~KStandardCardDeck();
 
61
 
 
62
    void setDeckContents( int copies = 1,
 
63
                          QList<Suit> suits = standardSuits(),
 
64
                          QList<Rank> ranks = standardRanks() );
 
65
 
 
66
protected:
 
67
    virtual QString elementName( quint32 id, bool faceUp = true ) const;
 
68
 
 
69
private:
 
70
    class KStandardCardDeckPrivate * const d;
 
71
};
 
72
 
 
73
LIBKCARDGAME_EXPORT KStandardCardDeck::Suit getSuit( const KCard * card );
 
74
LIBKCARDGAME_EXPORT KStandardCardDeck::Rank getRank( const KCard * card );
 
75
LIBKCARDGAME_EXPORT bool getIsRed( const KCard * card );
 
76
 
 
77
#endif