Adding irrelevant values to enums.

This commit is contained in:
Murilo Soares Pereira 2010-04-01 10:13:37 -03:00
parent f57073dc85
commit 7c3c72a0fd
2 changed files with 25 additions and 21 deletions

View File

@ -10,9 +10,9 @@ struct card *initialize_card() {
card = malloc(sizeof(card)); card = malloc(sizeof(card));
card->frame = initialize_frame(); card->frame = initialize_frame();
card->value = NONE; card->value = NO_VALUE;
card->suit = NONE; card->suit = NO_SUIT;
card->face = COVERED; card->face = NO_FACE;
return(card); return(card);
} }

View File

@ -1,33 +1,37 @@
#ifndef CARD_H #ifndef CARD_H
#define CARD_H #define CARD_H
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
};
enum suit { enum suit {
BLANK = -1, NO_SUIT = -1,
DIAMONDS = 0, DIAMONDS = 0,
SPADES = 1, SPADES = 1,
HEARTS = 2, HEARTS = 2,
CLUBS = 3 CLUBS = 3
}; };
enum value { enum face {
NONE = -1, NO_FACE = -1,
TWO = 2, COVERED = 0,
THREE = 3, EXPOSED = 1
FOUR = 4,
FIVE = 5,
SIX = 6,
SEVEN = 7,
EIGHT = 8,
NINE = 9,
TEN = 10,
JACK = 11,
QUEEN = 12,
KING = 13,
ACE = 14
}; };
enum face { COVERED, EXPOSED };
struct card { struct card {
struct frame *frame; struct frame *frame;
enum value value; enum value value;