56 Piece(
void) : M_code(), M_flags(fl_none) { }
81 Piece(
Piece const& piece) : M_code(piece.M_code), M_flags(piece.M_flags) { }
128 friend class testsuite::PieceTest;
Piece & operator=(Flags const& flags)
Just change the flags.
A namespace for all chess related objects that are not related to the GUI.
friend bool operator!=(Piece const& piece, Type const& type)
Return TRUE if piece is not a type.
Piece & operator=(Piece const& piece)
Assign from another Piece.
bool is(Color const& color) const
Return TRUE if the color is equal.
void set(FlagsData flags)
Set the bits that are set in flags.
friend bool operator!=(Type const& type, Piece const& piece)
Return TRUE if piece is not a type.
friend bool operator==(Piece const& piece1, Piece const& piece2)
Return TRUE if the Code of the pieces are equal.
FlagsData const fl_pawn_is_not_blocked
A constant representing the flag& #39;pawn is not blocked'.
friend bool operator==(Color const& color, Piece const& piece)
Return TRUE if piece has color color.
friend bool operator!=(Piece const& piece, Color const& color)
Return TRUE if piece does not have color color.
Piece(void)
Construct an empty piece (nothing).
Flags M_flags
Flags for this piece.
Flags representing the state of a piece on the chessboard.
friend bool operator==(Code const& code, Piece const& piece)
Return TRUE if piece has code code.
friend bool operator==(Piece const& piece, Code const& code)
Return TRUE if piece has code code.
Piece(Piece const& piece)
Copy-constructor.
Piece & operator=(Color const& color)
Just change the color.
Piece & operator=(Code const& code)
Just change the code.
friend bool operator==(Type const& type, Piece const& piece)
Return TRUE if piece is a type.
friend bool operator==(Piece const& piece, Type const& type)
Return TRUE if piece is a type.
FlagsData const fl_pawn_can_take_king_side
A constant representing the flag& #39;pawn can take king side'.
Type type(void) const
The type of this piece.
void reset(FlagsData flags)
Clear the bits that are set in flags.
Piece(Code const& code, Flags const& flags)
Construct a fully initialized Piece.
A particular piece on the board.
friend bool operator!=(Piece const& piece1, Piece const& piece2)
Return TRUE if the Code of the pieces are unequal.
void clear(void)
Set the type to nothing.
bool is_a(Type const& type) const
Returns TRUE if the type is equal.
friend bool operator==(Piece const& piece, Color const& color)
Return TRUE if piece has color color.
friend bool operator!=(Piece const& piece, Code const& code)
Return TRUE if piece does not have code code.
Color color(void) const
Return the color of the piece.
A chess piece type including color.
Piece(Color const& color, Type const& type)
Construct a fully initialized Piece with all Flags reset.
FlagsData const fl_pawn_can_move_two_squares
A constant representing the flag& #39;pawn can move two squares'.
Code M_code
The Code of this piece.
TypeData const nothing
A constant representing the absence of a piece.
void set_can_move_two_squares_if_not_blocked(void)
Set the fl_pawn_can_move_two_squares bit iff fl_pawn_is_not_blocked bit is already set...
Type type(void) const
Return the Type of this Code.
Flags flags(void) const
The flags of this piece.
A color (black or white).
This file contains the declaration of class Flags.
Piece & operator=(Type const& type)
Just change the type.
This file contains the declaration of class Code.
Color color(void) const
Return the Color of this Code.
Piece(Color const& color, Type const& type, Flags const& flags)
Construct a fully initialized Piece.
friend bool operator!=(Color const& color, Piece const& piece)
Return TRUE if piece does not have color color.
FlagsData const fl_pawn_can_take_queen_side
A constant representing the flag& #39;pawn can take queen side'.
void clear(void)
Set all flags to 0.
friend bool operator!=(Code const& code, Piece const& piece)
Return TRUE if piece does not have code code.
Code code(void) const
The code of this piece.