Introduce pet-projects dir
[lcapit-junk-code.git] / pet-projects / games / microballs / board.h
blobc3379889641c016eee0ca4d2766386788377fdc8
1 /*
2 * This file is licensed under the GPLv2 license
3 *
4 * Luiz Fernando N. Capitulino
5 * <lcapitulino@gmail.com>
6 */
7 #ifndef BOARD_H
8 #define BOARD_H
10 #include "mballs.h"
12 /* board sizes */
13 #define BOARD_DEF_SIZE 8
14 #define BOARD_MAX_SIZE 16
16 struct game_board {
17 enum game_piece board[BOARD_MAX_SIZE][BOARD_MAX_SIZE]; /* game board */
18 int row; /* number of rows in use */
19 int col; /* number of columns in use */
20 int free_positions; /* free positions in the board */
21 int balls_play1; /* number of player 1's balls */
22 int balls_play2; /* number of player 2's balls */
25 void board_init(struct game_board *board, int size);
26 void board_draw(const struct game_board *board);
27 enum game_state board_move(struct game_board *board,
28 const struct user_move *move);
29 int board_dst_is_valid(const struct game_board *board,
30 const struct user_move *move);
31 int board_src_is_valid(const struct game_board *board,
32 const struct user_move *move);
34 #endif /* BOARD_H */