From 135a8c9447ca19c4d609373b228bd096a2ae2ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sat, 22 Sep 2007 01:01:10 +0200 Subject: Added namespaces --- deck.h | 70 ++++++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 32 deletions(-) (limited to 'deck.h') diff --git a/deck.h b/deck.h index bd2d6db..5d0ea68 100644 --- a/deck.h +++ b/deck.h @@ -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 Cards; -/** --- class Deck --------------------------------------------------------- **/ - -class Deck +namespace Spider { -protected: - Cards allCards; -public: - int cardsInSuit; - int suitCount; - int deckCount; + class Card; + typedef Array 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 -- cgit v1.2.3