-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeck.h
51 lines (44 loc) · 1.33 KB
/
deck.h
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
/* deck.h
*
* Author: Michael Bossner
*
* deck.h header file for deck.c
*/
#ifndef DECK_H
#define DECK_H
#include <stdio.h>
#include "lib.h"
///////////////////////// Public Function Prototypes //////////////////////////
/*
* loads all cards out of a file into memory for game play
*
* Minimum amount of cards in a deck file should be at least 1.
* Format should be each card on it's own line with EOF on it's own line:
*
* "D:V:P,B,Y,R\n"
* "D:V:P,B,Y,R\n"
* "EOF"
*
* D: Colour of the card either 'B' || 'Y' || 'P' || 'R'
* v: number of points the card gives. Must be a positive number
* P: number of Purple tokens the card costs. Must be a positive number
* B: number of Brown tokens the card costs. Must be a positive number
* Y: number of Yellow tokens the card costs. Must be a positive number
* R: number of Red tokens the card costs. Must be a positive number
*
* deckFile: Name of the file that contains the deck
*
* state: Contains all information needed to keep track of the game
*
* Error 3: Cannot access deck file.
*
* Error 4: Invalid deck file contents. deckFile does not meet the format
*/
void load_deck_file(char* deckFileName, GameState* state);
/*
* frees the entire deck pile from memory
*
* state: Contains all information needed to keep track of the game
*/
void free_deck(GameState* state);
#endif