tty-solitaire/lib/card.h

53 lines
854 B
C
Raw Normal View History

2010-04-01 05:28:00 +00:00
#ifndef CARD_H
#define CARD_H
2010-04-05 00:54:22 +00:00
#include "frame.h"
2010-04-01 13:13:37 +00:00
enum value {
NO_VALUE = -1,
TWO = 2,
THREE = 3,
FOUR = 4,
FIVE = 5,
SIX = 6,
SEVEN = 7,
EIGHT = 8,
NINE = 9,
TEN = 10,
JACK = 11,
QUEEN = 12,
KING = 13,
ACE = 14
};
2010-04-01 05:28:00 +00:00
enum suit {
2010-04-01 13:13:37 +00:00
NO_SUIT = -1,
2010-04-01 05:28:00 +00:00
DIAMONDS = 0,
SPADES = 1,
HEARTS = 2,
CLUBS = 3
};
2010-04-01 13:13:37 +00:00
enum face {
NO_FACE = -1,
COVERED = 0,
EXPOSED = 1
2010-04-01 05:28:00 +00:00
};
struct card {
struct frame *frame;
enum value value;
enum suit suit;
2010-04-01 13:18:57 +00:00
enum face face;
2010-04-01 05:28:00 +00:00
};
void allocate_card(struct card **);
void initialize_card(struct card *);
2011-05-01 06:06:43 +00:00
struct card *duplicate_card(struct card *);
2011-02-14 02:10:47 +00:00
void free_card(struct card *);
void set_card(struct card *, enum value, enum suit, enum face, int, int);
void expose_card(struct card *);
void cover_card(struct card *);
2010-04-01 05:28:00 +00:00
#endif