author | zecke <zecke> | 2004-02-06 12:14:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-06 12:14:56 (UTC) |
commit | 0c74629e8f5c12a9b5a282b817f884fa10dee491 (patch) (side-by-side diff) | |
tree | 3294663b92023f8d24d68a01022e011a3c94002d /noncore/games/solitaire/carddeck.cpp | |
parent | 46ce5afcfbe7be19f4d5ac0fed6886a0759f1a25 (diff) | |
download | opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.zip opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.gz opie-0c74629e8f5c12a9b5a282b817f884fa10dee491.tar.bz2 |
Merge from the 1.0.x release
Diffstat (limited to 'noncore/games/solitaire/carddeck.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/solitaire/carddeck.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/solitaire/carddeck.cpp b/noncore/games/solitaire/carddeck.cpp index a2d0076..b130131 100644 --- a/noncore/games/solitaire/carddeck.cpp +++ b/noncore/games/solitaire/carddeck.cpp @@ -4,49 +4,49 @@ ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <stdlib.h> #include <time.h> #include "card.h" #include "carddeck.h" CardDeck::CardDeck(int jokers, int numOfDecks) : numberOfJokers(jokers), numberOfDecks(numOfDecks), deckCreated(FALSE) { - cards = new (Card *)[getNumberOfCards()]; + cards = new Card *[getNumberOfCards()]; } CardDeck::~CardDeck() { for (int i = 0; i < getNumberOfCards(); i++) delete cards[i]; delete cards; } void CardDeck::createDeck() { if (!deckCreated) { for (int j = 0; j < getNumberOfDecks(); j++) { for (int i = 0; i < 52; i++) { cards[i+j*52] = newCard( (eValue)((i % 13) + 1), (eSuit)((i / 13) + 1), FALSE); cards[i+j*52]->setDeckNumber(j); } } for (int i = 0; i < getNumberOfJokers(); i++) cards[52*getNumberOfDecks() + i] = newCard( jokerVal, jokerSuit, FALSE); deckCreated = TRUE; } |