diff options
author | Thomas Günther <tom@toms-cafe.de> | 2007-09-22 01:01:10 +0200 |
---|---|---|
committer | Thomas Günther <tom@toms-cafe.de> | 2007-09-22 01:01:10 +0200 |
commit | 135a8c9447ca19c4d609373b228bd096a2ae2ab8 (patch) | |
tree | 1f24e7f3d0d4531d1a5bd705b89c40e7c3c29d33 /deck.h | |
parent | b39a6bf3e7add336dbb127394e8c611ec1d29cd6 (diff) | |
download | vdr-plugin-spider-135a8c9447ca19c4d609373b228bd096a2ae2ab8.tar.gz vdr-plugin-spider-135a8c9447ca19c4d609373b228bd096a2ae2ab8.tar.bz2 |
Added namespaces
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 |