From 5adba921f9a7dc695a60a89b3288e6294952aa5d Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Sun, 6 Feb 2011 04:03:40 -0200 Subject: [PATCH] Moving stack-related constants to the stack header file. --- lib/game.h | 22 +--------------------- lib/stack.c | 1 - lib/stack.h | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/game.h b/lib/game.h index 63efad0..9acc549 100644 --- a/lib/game.h +++ b/lib/game.h @@ -1,32 +1,12 @@ #ifndef GAME_H #define GAME_H +#include "stack.h" #include "deck.h" #include "cursor.h" #define NUMBER_OF_CARDS 52 -#define STOCK_STARTING_X 1 -#define STOCK_STARTING_Y 1 - -#define WASTE_PILE_STARTING_X 9 -#define WASTE_PILE_STARTING_Y 1 - -#define FOUNDATION_STARTING_Y 1 -#define FOUNDATION_0_STARTING_X 25 -#define FOUNDATION_1_STARTING_X 33 -#define FOUNDATION_2_STARTING_X 41 -#define FOUNDATION_3_STARTING_X 49 - -#define MANEUVRE_STARTING_Y 9 -#define MANEUVRE_0_STARTING_X 1 -#define MANEUVRE_1_STARTING_X 9 -#define MANEUVRE_2_STARTING_X 17 -#define MANEUVRE_3_STARTING_X 25 -#define MANEUVRE_4_STARTING_X 33 -#define MANEUVRE_5_STARTING_X 41 -#define MANEUVRE_6_STARTING_X 49 - extern const char *program_name; struct deck *deck; struct cursor *cursor; diff --git a/lib/stack.c b/lib/stack.c index 7ce107b..a6b8ff9 100644 --- a/lib/stack.c +++ b/lib/stack.c @@ -5,7 +5,6 @@ #include #include #include "stack.h" -#include "game.h" void allocate_stack(struct stack **stack) { if (!(*stack = malloc(sizeof(**stack)))) { diff --git a/lib/stack.h b/lib/stack.h index 5a31ab6..c79ee4d 100644 --- a/lib/stack.h +++ b/lib/stack.h @@ -5,6 +5,27 @@ #define MANEUVRE_STACKS_STARTING_Y 7 +#define STOCK_STARTING_X 1 +#define STOCK_STARTING_Y 1 + +#define WASTE_PILE_STARTING_X 9 +#define WASTE_PILE_STARTING_Y 1 + +#define FOUNDATION_STARTING_Y 1 +#define FOUNDATION_0_STARTING_X 25 +#define FOUNDATION_1_STARTING_X 33 +#define FOUNDATION_2_STARTING_X 41 +#define FOUNDATION_3_STARTING_X 49 + +#define MANEUVRE_STARTING_Y 9 +#define MANEUVRE_0_STARTING_X 1 +#define MANEUVRE_1_STARTING_X 9 +#define MANEUVRE_2_STARTING_X 17 +#define MANEUVRE_3_STARTING_X 25 +#define MANEUVRE_4_STARTING_X 33 +#define MANEUVRE_5_STARTING_X 41 +#define MANEUVRE_6_STARTING_X 49 + struct stack { struct card *card; struct stack *next;