summaryrefslogtreecommitdiff
path: root/deck.h
blob: 30afb89250736bd2f9f4eb2cb9e0e89de5d5551c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Spider-Arachnid: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */

#ifndef VDR_SPIDER_DECK_H
#define VDR_SPIDER_DECK_H

#include "spider.h"
class Card;
typedef Array<Card> Cards;


/** --- class Deck --------------------------------------------------------- **/

class Deck
{
protected:
  Cards allCards;
public:
  int cardsInSuit;
  int suitCount;
  int deckCount;

  /** Constructor */
  Deck(int cards, int suits, int decks);

  /** Current count of cards */
  int count() const;

  /** Card in deck */
  const Card& card(int position) const;

  /** Shuffle the deck */
  void shuffle();
};


/** --- class Card --------------------------------------------------------- **/

class Card
{
public:
  int suit;
  int rank;

  /** Constructor */
  Card(int s = -1, int r = -1);

  /** Matches this card to an other card? */
  bool matchesTo(const Card& other) const;
};

#endif // VDR_SPIDER_DECK_H