Putting functions were they belong.
This commit is contained in:
parent
3420045a35
commit
daf0b4809f
16
lib/cursor.c
16
lib/cursor.c
@ -24,18 +24,6 @@ void initialize_cursor(struct cursor *cursor) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_cursor(struct cursor *cursor) {
|
|
||||||
mvaddch(cursor->y, cursor->x, '*');
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void erase_cursor(struct cursor *cursor) {
|
|
||||||
mvdelch(cursor->y, cursor->x);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void move_cursor(struct cursor *cursor, enum movement movement) {
|
void move_cursor(struct cursor *cursor, enum movement movement) {
|
||||||
switch (movement) {
|
switch (movement) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
@ -105,7 +93,3 @@ void move_cursor(struct cursor *cursor, enum movement movement) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cursor_on_stock(struct cursor *cursor) {
|
|
||||||
return((cursor->x == CURSOR_STARTING_X) && (cursor->y == CURSOR_STARTING_Y));
|
|
||||||
}
|
|
||||||
|
@ -36,8 +36,6 @@ extern const char *program_name;
|
|||||||
|
|
||||||
void allocate_cursor(struct cursor **);
|
void allocate_cursor(struct cursor **);
|
||||||
void initialize_cursor(struct cursor *);
|
void initialize_cursor(struct cursor *);
|
||||||
void draw_cursor(struct cursor *);
|
|
||||||
void move_cursor(struct cursor *, enum movement);
|
void move_cursor(struct cursor *, enum movement);
|
||||||
bool cursor_on_stock(struct cursor *);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ncurses.h>
|
#include <ncurses.h>
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "game.h"
|
|
||||||
|
|
||||||
static char *card_suit(enum suit suit) {
|
static char *card_suit(enum suit suit) {
|
||||||
char *card_suit;
|
char *card_suit;
|
||||||
@ -229,3 +228,15 @@ void draw_deck(struct deck *deck) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void draw_cursor(struct cursor *cursor) {
|
||||||
|
mvaddch(cursor->y, cursor->x, '*');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void erase_cursor(struct cursor *cursor) {
|
||||||
|
mvdelch(cursor->y, cursor->x);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "card.h"
|
#include "card.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
#include "deck.h"
|
#include "deck.h"
|
||||||
|
#include "cursor.h"
|
||||||
|
|
||||||
#define EMPTY_STACKS_NUMBER 13
|
#define EMPTY_STACKS_NUMBER 13
|
||||||
|
|
||||||
@ -28,5 +29,7 @@ void draw_back(struct card *);
|
|||||||
void draw_card(struct card *);
|
void draw_card(struct card *);
|
||||||
void draw_stack(struct stack *);
|
void draw_stack(struct stack *);
|
||||||
void draw_deck(struct deck *);
|
void draw_deck(struct deck *);
|
||||||
|
void draw_cursor(struct cursor *);
|
||||||
|
void erase_cursor(struct cursor *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
|
|
||||||
|
static bool cursor_on_stock(struct cursor *cursor) {
|
||||||
|
return((cursor->x == CURSOR_STARTING_X) && (cursor->y == CURSOR_STARTING_Y));
|
||||||
|
}
|
||||||
|
|
||||||
static struct stack *cursor_stack(struct cursor *cursor) {
|
static struct stack *cursor_stack(struct cursor *cursor) {
|
||||||
struct stack *cursor_stack = NULL;
|
struct stack *cursor_stack = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user