2011-06-06 04:33:49 +00:00
|
|
|
#ifndef TTY_SOLITAIRE_CURSOR_H
|
|
|
|
#define TTY_SOLITAIRE_CURSOR_H
|
2010-04-20 04:10:42 +00:00
|
|
|
|
2010-04-20 17:11:16 +00:00
|
|
|
#include <stdbool.h>
|
2010-04-21 07:14:39 +00:00
|
|
|
#include "deck.h"
|
2010-04-20 17:11:16 +00:00
|
|
|
|
2011-05-09 03:38:31 +00:00
|
|
|
#define CURSOR_BEGIN_X 4
|
|
|
|
#define CURSOR_BEGIN_Y 7
|
2010-04-20 04:10:42 +00:00
|
|
|
|
2011-02-06 01:42:14 +00:00
|
|
|
#define CURSOR_INVALID_SPOT_X 20
|
|
|
|
#define CURSOR_INVALID_SPOT_Y 7
|
|
|
|
|
2010-04-22 04:50:19 +00:00
|
|
|
#define CURSOR_STOCK_X 4
|
|
|
|
#define CURSOR_WASTE_PILE_X 12
|
|
|
|
#define CURSOR_FOUNDATION_0_X 28
|
|
|
|
#define CURSOR_FOUNDATION_1_X 36
|
|
|
|
#define CURSOR_FOUNDATION_2_X 44
|
|
|
|
#define CURSOR_FOUNDATION_3_X 52
|
|
|
|
#define CURSOR_MANEUVRE_0_X 4
|
|
|
|
#define CURSOR_MANEUVRE_1_X 12
|
|
|
|
#define CURSOR_MANEUVRE_2_X 20
|
|
|
|
#define CURSOR_MANEUVRE_3_X 28
|
|
|
|
#define CURSOR_MANEUVRE_4_X 36
|
|
|
|
#define CURSOR_MANEUVRE_5_X 44
|
|
|
|
#define CURSOR_MANEUVRE_6_X 52
|
|
|
|
|
2010-04-20 04:10:42 +00:00
|
|
|
struct cursor {
|
2011-05-09 05:04:38 +00:00
|
|
|
WINDOW *window;
|
2010-04-20 04:10:42 +00:00
|
|
|
int x;
|
|
|
|
int y;
|
2011-05-31 05:42:10 +00:00
|
|
|
bool marked;
|
2010-04-20 04:10:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum movement { LEFT, DOWN, UP, RIGHT };
|
|
|
|
|
|
|
|
extern struct deck *deck;
|
2011-06-08 05:36:46 +00:00
|
|
|
extern struct game game;
|
2010-04-20 04:10:42 +00:00
|
|
|
|
2011-06-06 05:21:50 +00:00
|
|
|
void cursor_malloc(struct cursor **);
|
|
|
|
void cursor_init(struct cursor *);
|
|
|
|
void cursor_free(struct cursor *);
|
|
|
|
void cursor_mark(struct cursor *);
|
|
|
|
void cursor_unmark(struct cursor *);
|
|
|
|
void cursor_move(struct cursor *, enum movement);
|
2011-06-07 01:06:10 +00:00
|
|
|
enum movement cursor_direction(int);
|
2011-06-07 01:19:08 +00:00
|
|
|
struct stack **cursor_stack(struct cursor *);
|
|
|
|
bool cursor_on_stock(struct cursor *);
|
|
|
|
bool cursor_on_invalid_spot(struct cursor *);
|
2010-04-20 04:10:42 +00:00
|
|
|
|
|
|
|
#endif
|