Add player's pieces list management + change board def.

This commit is contained in:
2021-10-30 22:03:17 +02:00
parent f0d209a292
commit 4bba067cd6
8 changed files with 114 additions and 37 deletions

View File

@@ -17,8 +17,20 @@
#include "chessdefs.h"
#include "board.h"
#include "list.h"
#include "position.h"
#include "pool.h"
typedef struct piece {
#define PIECE_DEFAULT_VALUE 0
/* initial default values */
#define PAWN_VALUE 100
#define KNIGHT_VALUE 300
#define BISHOP_VALUE 300
#define ROOK_VALUE 500
#define QUEEN_VALUE 900
#define KING_VALUE 20000
typedef struct {
piece_t piece;
square_t square;
short castle;
@@ -26,4 +38,9 @@ typedef struct piece {
struct list_head list;
} piece_list_t;
void piece_list_print(struct list_head *list);
void pieces_print_pos_pieces(pos_t *pos);
pool_t *piece_pool_init();
piece_list_t *piece_add(pos_t *pos, piece_t piece, square_t square);
#endif