mtglist

diff src/mtg.h @ 0:0a45dfe93e66

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Nov 2014 11:07:45 +0200
parents
children 7211fa8db425
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/mtg.h	Sun Nov 02 11:07:45 2014 +0200
     1.3 @@ -0,0 +1,52 @@
     1.4 +#ifndef MTG_H_
     1.5 +#define MTG_H_
     1.6 +
     1.7 +#define MTG_COL_NONE		0
     1.8 +#define MTG_COL_RED			1
     1.9 +#define MTG_COL_GREEN		2
    1.10 +#define MTG_COL_BLUE		4
    1.11 +#define MTG_COL_BLACK		8
    1.12 +#define MTG_COL_WHITE		16
    1.13 +#define MTG_COL_ARTIFACT	32
    1.14 +#define MTG_COL_MULTI		0xff
    1.15 +
    1.16 +enum mtg_card_type {
    1.17 +	MTG_TYPE_UNKNOWN,
    1.18 +
    1.19 +	MTG_TYPE_LAND,
    1.20 +	MTG_TYPE_CREATURE,
    1.21 +	MTG_TYPE_SORCERY,
    1.22 +	MTG_TYPE_INSTANT,
    1.23 +	MTG_TYPE_ENCHANTMENT,
    1.24 +	MTG_TYPE_ARTIFACT,
    1.25 +	MTG_TYPE_PLANESWALKER
    1.26 +};
    1.27 +
    1.28 +
    1.29 +struct mtg_card {
    1.30 +	char *name;
    1.31 +	unsigned int color;
    1.32 +	enum mtg_card_type type;
    1.33 +	const char *edition;
    1.34 +	int count;
    1.35 +};
    1.36 +
    1.37 +int mtg_init(void);
    1.38 +void mtg_destroy(void);
    1.39 +
    1.40 +int mtg_load_cards(const char *fname);
    1.41 +
    1.42 +void mtg_iter_begin(void);
    1.43 +const struct mtg_card *mtg_iter_next(void);
    1.44 +
    1.45 +const char *mtg_color_str(unsigned int color);
    1.46 +
    1.47 +const char *mtg_type_str(enum mtg_card_type type);
    1.48 +enum mtg_card_type mtg_str_type(const char *s);
    1.49 +
    1.50 +const char *mtg_edition(const char *edcode);
    1.51 +
    1.52 +int mtg_is_multicolor(unsigned int color);
    1.53 +
    1.54 +
    1.55 +#endif	/* MTG_H_ */