diff options
Diffstat (limited to 'deck.h')
-rw-r--r-- | deck.h | 70 |
1 files changed, 38 insertions, 32 deletions
@@ -17,55 +17,61 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * $Id: deck.h 87 2007-06-22 22:37:36Z tom $ + * $Id: deck.h 95 2007-09-21 23:01:10Z tom $ */ #ifndef VDR_SPIDER_DECK_H #define VDR_SPIDER_DECK_H #include "spider.h" -class Card; -typedef Array<Card> Cards; -/** --- class Deck --------------------------------------------------------- **/ - -class Deck +namespace Spider { -protected: - Cards allCards; -public: - int cardsInSuit; - int suitCount; - int deckCount; + class Card; + typedef Array<Card> Cards; - /** Constructor */ - Deck(int cards, int suits, int decks); - /** Current count of cards */ - int count() const; + //--- class Spider::Deck ----------------------------------------------------- - /** Card in deck */ - const Card& card(int position) const; + class Deck + { + protected: + Cards allCards; + public: + int cardsInSuit; + int suitCount; + int deckCount; - /** Shuffle the deck */ - void shuffle(); -}; + /** Constructor */ + Deck(int cards, int suits, int decks); + /** Current count of cards */ + int count() const; -/** --- class Card --------------------------------------------------------- **/ + /** Card in deck */ + const Card& card(int position) const; -class Card -{ -public: - int suit; - int rank; + /** Shuffle the deck */ + void shuffle(); + }; + + + //--- class Spider::Card ----------------------------------------------------- + + class Card + { + public: + int suit; + int rank; + + /** Constructor */ + Card(int s = -1, int r = -1); - /** Constructor */ - Card(int s = -1, int r = -1); + /** Matches this card to an other card? */ + bool matchesTo(const Card& other) const; + }; - /** Matches this card to an other card? */ - bool matchesTo(const Card& other) const; -}; +} // namespace Spider #endif // VDR_SPIDER_DECK_H |