diff options
Diffstat (limited to 'src/board.h')
-rw-r--r-- | src/board.h | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/src/board.h b/src/board.h index cd78901..3d3fdc2 100644 --- a/src/board.h +++ b/src/board.h @@ -1,22 +1,8 @@ -#define BOARD_WIDTH 9 +#pragma once +#include "config.h" + #define BOARD_ROW_UNITS ((BOARD_WIDTH * 2) + 1) #define BOARD_UNITS BOARD_ROW_UNITS * BOARD_ROW_UNITS -#define PLAYERS 2 -#define MAX_STRUCTURES 100 - -/* constants */ -const char EMPTY = ' '; -const char ANY = '*'; -const char SEPARATOR = '+'; - -const int NEIGHBOR_INCREMENTS[] = { -BOARD_ROW_UNITS, 1, BOARD_ROW_UNITS, -1 }; - -/* structs */ -typedef struct { - char edges[4]; - char center; - int shield; -} Tile; typedef struct { char feature; @@ -24,23 +10,12 @@ typedef struct { int structure_group; } BoardUnit; -/* board */ +static const char EMPTY = ' '; +static const char ANY = '*'; +static const char SEPARATOR = '+'; + +static const int NEIGHBOR_INCREMENTS[] = { -BOARD_ROW_UNITS, 1, BOARD_ROW_UNITS, -1 }; + void initialize_board(BoardUnit* board); int translate_coordinate(int index); int is_center_index(int index); - -/* tiles */ -int is_allowed_placement(Tile tile, int index, BoardUnit* board); -int place_tile(Tile tile, int index, BoardUnit* board, int force); -void rotate_tile(Tile* tile, int increment); - -/* structures */ -void traverse_structure(int group, int index, BoardUnit* board); -void refresh_structure_groups(BoardUnit* board); -int evaluate_structure(int index, BoardUnit* board); - - -/* meeples */ -int is_allowed_meeple(int meeple, int index, BoardUnit* board, int* meeple_map); -void refresh_meeple_map(BoardUnit* board, int* meeple_map); -int get_structure_dominator(int structure_group, int* meeple_map); |