structures forward declarations
This commit is contained in:
@@ -16,10 +16,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "chessdefs.h"
|
||||
#include "piece.h"
|
||||
#include "position.h"
|
||||
|
||||
typedef struct {
|
||||
typedef struct board_s {
|
||||
piece_t piece;
|
||||
//piece_t *s_piece;
|
||||
piece_list_t *s_piece;
|
||||
} board_t; /* 0x88 board */
|
||||
#define BOARDSIZE (8*8*2)
|
||||
|
||||
@@ -51,4 +53,4 @@ typedef struct {
|
||||
#define FILE2C(f) ((f) + 'a')
|
||||
#define RANK2C(r) ((r) + '1')
|
||||
|
||||
#endif
|
||||
#endif /* BOARD_H */
|
||||
|
||||
@@ -73,4 +73,10 @@ typedef unsigned char castle_t;
|
||||
*/
|
||||
typedef int64_t eval_t;
|
||||
|
||||
/* forward typedefs
|
||||
*/
|
||||
typedef struct piece_list_s piece_list_t;
|
||||
typedef struct board_s board_t;
|
||||
typedef struct pos_s pos_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -84,7 +84,7 @@ pos_t *fen2pos(pos_t *pos, char *fen)
|
||||
# endif
|
||||
piece |= color;
|
||||
board[SQ88(file, rank)].piece = piece;
|
||||
piece_add(pos, piece, SQUARE(file, rank));
|
||||
board[SQ88(file, rank)].s_piece = piece_add(pos, piece, SQUARE(file, rank));
|
||||
file++;
|
||||
break;
|
||||
case '/':
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
#ifndef PIECE_H
|
||||
#define PIECE_H
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "chessdefs.h"
|
||||
#include "board.h"
|
||||
#include "list.h"
|
||||
#include "position.h"
|
||||
#include "pool.h"
|
||||
#include "ctype.h"
|
||||
|
||||
#define PIECE_DEFAULT_VALUE 0
|
||||
|
||||
@@ -31,7 +32,7 @@
|
||||
#define QUEEN_VALUE 900
|
||||
#define KING_VALUE 20000
|
||||
|
||||
typedef struct {
|
||||
typedef struct piece_list_s {
|
||||
piece_t piece;
|
||||
square_t square;
|
||||
short castle;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "board.h"
|
||||
#include "list.h"
|
||||
|
||||
typedef struct position {
|
||||
typedef struct pos_s {
|
||||
piece_t turn; /* we use only color bit */
|
||||
castle_t castle;
|
||||
square_t en_passant;
|
||||
|
||||
Reference in New Issue
Block a user