piece.h (647B)
1 #ifndef STELLAR_PIECE_H 2 #define STELLAR_PIECE_H 3 4 #include "attacks.h" 5 6 typedef const struct Piece *Piece; 7 8 typedef enum enumColor eColor; 9 enum enumColor { 10 WHITE = 0, 11 BLACK 12 }; 13 14 typedef enum enumPiece ePiece; 15 enum enumPiece { 16 PAWN = 0, 17 KNIGHT, 18 BISHOP, 19 ROOK, 20 QUEEN, 21 KING 22 }; 23 24 char piece_asci(Piece self); 25 attack_f piece_attacks(Piece self); 26 char piece_code(Piece self); 27 char *piece_unicode(Piece self); 28 eColor piece_color(Piece self); 29 ePiece piece_piece(Piece self); 30 int piece_index(Piece self); 31 32 Piece piece_get(ePiece piece, eColor color); 33 Piece piece_from_code(char code); 34 Piece piece_from_index(int index); 35 36 #endif