tty-solitaire/src/card.h

43 lines
787 B
C
Raw Normal View History

2011-06-06 04:33:49 +00:00
#ifndef TTY_SOLITAIRE_CARD_H
#define TTY_SOLITAIRE_CARD_H
2010-04-01 05:28:00 +00:00
2010-04-05 00:54:22 +00:00
#include "frame.h"
2010-04-01 13:13:37 +00:00
enum value {
NO_VALUE = -1,
2011-06-03 03:07:02 +00:00
ACE,
TWO,
THREE,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE,
TEN,
JACK,
QUEEN,
KING
2010-04-01 05:28:00 +00:00
};
2011-06-03 03:07:02 +00:00
enum suit { NO_SUIT = -1, DIAMONDS, SPADES, HEARTS, CLUBS };
enum face { NO_FACE = -1, COVERED, EXPOSED };
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-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 *);
2011-06-03 05:48:26 +00:00
struct card *duplicate_card(struct card *);
void mark_card(struct card *);
void unmark_card(struct card *);
2010-04-01 05:28:00 +00:00
#endif