26 #include <gtkmm/radioaction.h> 27 #include <gtkmm/stock.h> 37 bool ChessPositionWidget::execute(
Move const& move)
39 Code code(piece_at(move.
from()).code());
42 EnPassant const& en_passant(this->en_passant());
50 set_square(move.
to().
col(), move.
to().
row(), code);
52 if (code.is_a(
king) && col_diff && !(col_diff & 1))
54 IndexData rook_from_data = {
static_cast<uint8_t
>(move.
from()() - 4 + 7 * (2 + move.
to()() - move.
from()()) / 4) };
55 IndexData rook_to_data = {
static_cast<uint8_t
>(move.
from()() + (move.
to()() - move.
from()()) / 2) };
56 Index rook_from(rook_from_data);
57 Index rook_to(rook_to_data);
61 set_active_turn_indicator(to_move().is_white());
64 void ChessPositionWidget::sync(
void)
72 set_square(index.col(), index.row(), piece_at(index).code());
75 set_active_turn_indicator(to_move().is_white());
78 bool ChessPositionWidget::load_FEN(std::string
const& FEN)
87 bool ChessPositionWidget::popup_menu(GdkEventButton* event,
int col,
int row)
89 DoutEntering(dc::notice|dc::clipboard,
"ChessPositionWidget::popup_menu(" << col <<
", " << row <<
")");
93 M_refActionGroup->get_action(
"PlacepieceBlackPawn")->set_sensitive(row != 0 && row != 7);
94 M_refActionGroup->get_action(
"PlacepieceWhitePawn")->set_sensitive(row != 0 && row != 7);
97 if (to_move().is_white())
98 M_refToMoveWhite_action->set_active(
true);
100 M_refToMoveBlack_action->set_active(
true);
101 Piece const& piece(piece_at(M_placepiece_index));
102 M_refActionGroup->get_action(
"PlacepieceNothing")->set_visible(piece !=
nothing);
103 bool can_be_taken_en_passant =
105 piece_at(M_placepiece_index + south.offset) ==
nothing&&
106 piece_at(M_placepiece_index + 2 * south.offset) ==
nothing) ||
108 piece_at(M_placepiece_index + north.offset) ==
nothing&&
109 piece_at(M_placepiece_index + 2 * north.offset) ==
nothing);
110 M_refActionGroup->get_action(
"AllowEnPassantCapture")->set_visible(can_be_taken_en_passant);
111 if (can_be_taken_en_passant)
113 M_AllowEnPassantCapture_connection.block();
114 M_refAllowEnPassantCapture_action->set_active(en_passant().exists() && en_passant().pawn_index() == M_placepiece_index);
115 M_AllowEnPassantCapture_connection.unblock();
117 bool is_castle_piece =
122 M_refActionGroup->get_action(
"PieceHasMoved")->set_visible(is_castle_piece);
125 M_PieceHasMoved_connection.block();
126 M_refPieceHasMoved_action->set_active(has_moved(M_placepiece_index));
127 M_PieceHasMoved_connection.unblock();
129 update_paste_status();
130 M_MenuPopup->popup(event->button, event->time);
136 void ChessPositionWidget::on_menu_placepiece_black_pawn(
void)
141 void ChessPositionWidget::on_menu_placepiece_black_rook(
void)
146 void ChessPositionWidget::on_menu_placepiece_black_knight(
void)
151 void ChessPositionWidget::on_menu_placepiece_black_bishop(
void)
156 void ChessPositionWidget::on_menu_placepiece_black_queen(
void)
161 void ChessPositionWidget::on_menu_placepiece_black_king(
void)
166 void ChessPositionWidget::on_menu_placepiece_white_pawn(
void)
171 void ChessPositionWidget::on_menu_placepiece_white_rook(
void)
176 void ChessPositionWidget::on_menu_placepiece_white_knight(
void)
181 void ChessPositionWidget::on_menu_placepiece_white_bishop(
void)
186 void ChessPositionWidget::on_menu_placepiece_white_queen(
void)
191 void ChessPositionWidget::on_menu_placepiece_white_king(
void)
196 void ChessPositionWidget::on_menu_placepiece_nothing(
void)
201 void ChessPositionWidget::on_menu_allow_en_passant_capture(
void)
203 bool en_passant_allowed = en_passant().exists() && en_passant().pawn_index() == M_placepiece_index;
205 if (!en_passant_allowed)
207 Index passed_square(M_placepiece_index);
208 if (piece_at(M_placepiece_index) ==
black)
209 passed_square += north.offset;
211 passed_square += south.offset;
212 set_en_passant(passed_square);
216 void ChessPositionWidget::on_menu_piece_has_moved(
void)
218 if (has_moved(M_placepiece_index))
219 clear_has_moved(M_placepiece_index);
221 set_has_moved(M_placepiece_index);
224 void ChessPositionWidget::on_menu_copy_FEN(
void)
226 DoutEntering(dc::clipboard,
"ChessPositionWidget::on_menu_copy_FEN");
227 Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
228 std::list<Gtk::TargetEntry> targets;
229 targets.push_back(Gtk::TargetEntry(
"UTF8_STRING"));
230 Glib::ustring clipboard_store = FEN();
232 M_clipboard_content = clipboard_store;
234 if (!refClipboard->set(targets,
235 sigc::mem_fun(*
this,& ChessPositionWidget::on_clipboard_get),
236 sigc::mem_fun(*
this,& ChessPositionWidget::on_clipboard_clear)))
237 g_warning(
"ChessPositionWidget::on_menu_copy_FEN(): setting the clipboard data failed.");
239 M_clipboard_content = clipboard_store;
240 Dout(dc::clipboard,
"Storing \"" << M_clipboard_content <<
"\".");
243 void ChessPositionWidget::on_menu_paste_FEN(
void)
245 DoutEntering(dc::clipboard,
"ChessPositionWidget::on_menu_paste_FEN");
246 Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
247 refClipboard->request_text(sigc::mem_fun(*
this,& ChessPositionWidget::on_clipboard_received));
250 void ChessPositionWidget::on_clipboard_get(Gtk::SelectionData& selection_data, guint)
252 std::string
const target = selection_data.get_target();
254 DoutEntering(dc::clipboard,
"ChessPositionWidget::on_clipboard_get(...) with target data \"" << target <<
"\".");
256 if (target ==
"UTF8_STRING")
258 Dout(dc::clipboard,
"Passing back \"" << M_clipboard_content <<
"\".");
259 selection_data.set_text(M_clipboard_content);
262 g_warning(
"ChessPositionWidget::on_clipboard_get(): Unexpected clipboard target format.");
265 void ChessPositionWidget::on_clipboard_clear(
void)
267 DoutEntering(dc::clipboard,
"ChessPositionWidget::on_clipboard_clear()");
268 M_clipboard_content.clear();
271 void ChessPositionWidget::on_clipboard_received(Glib::ustring
const& text)
273 DoutEntering(dc::clipboard,
"ChessPositionWidget::on_clipboard_received(\"" << text <<
"\").");
275 if (!load_FEN(text) && !M_trying_primary)
277 Dout(dc::clipboard,
"No FEN in CLIPBOARD. Trying PRIMARY.");
278 Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get(GDK_SELECTION_PRIMARY);
279 M_trying_primary =
true;
280 refClipboard->request_text(sigc::mem_fun(*
this,& ChessPositionWidget::on_clipboard_received));
283 M_trying_primary =
false;
286 void ChessPositionWidget::update_paste_status(
void)
288 DoutEntering(dc::clipboard,
"ChessPositionWidget::update_paste_status()");
289 M_refActionGroup->get_action(
"PasteFEN")->set_sensitive(
false);
290 Dout(dc::clipboard,
"paste disabled.");
291 Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
292 refClipboard->request_targets(sigc::mem_fun(*
this,& ChessPositionWidget::on_clipboard_received_targets));
295 void ChessPositionWidget::on_clipboard_received_targets(Glib::StringArrayHandle
const& targets_array)
297 DoutEntering(dc::clipboard,
"ChessPositionWidget::on_clipboard_received_targets(...).");
299 typedef std::list<Glib::ustring> targets_type;
300 targets_type targets = targets_array;
301 if (std::find(targets.begin(), targets.end(),
"UTF8_STRING") != targets.end())
303 Dout(dc::clipboard,
"Target found; paste enabled.");
304 M_refActionGroup->get_action(
"PasteFEN")->set_sensitive(
true);
308 void ChessPositionWidget::on_menu_swap_colors(
void)
313 void ChessPositionWidget::on_menu_initial_position(
void)
318 void ChessPositionWidget::on_menu_clear_board(
void)
323 void ChessPositionWidget::on_menu_to_move_white(
void)
328 void ChessPositionWidget::on_menu_to_move_black(
void)
333 void ChessPositionWidget::initialize_menus(
void)
335 DoutEntering(dc::notice,
"ChessPositionWidget::initialize_menus");
337 M_refIconFactory = Gtk::IconFactory::create();
338 M_refIconFactory->add_default();
340 GdkColor light_square_color;
341 get_light_square_color(light_square_color);
344 for (
bool iswhite =
false; color_count < 2; ++color_count, iswhite =
true)
350 Glib::RefPtr<Gdk::Pixmap> icon_pixmap = Gdk::Pixmap::create(M_drawable->get_window(), 16, 16);
351 Cairo::RefPtr<Cairo::Context> cairo_context = icon_pixmap->create_cairo_context();
352 cairo_t* cr = cairo_context->cobj();
353 cairo_set_source_rgb(cr, light_square_color.red / 65535.0, light_square_color.green / 65535.0, light_square_color.blue / 65535.0);
355 std::string icon_str(iswhite ?
"white_" :
"black_");
359 icon_str +=
"nothing";
362 draw_pawn(cr, 8, 8, 16, iswhite);
366 draw_rook(cr, 8, 8, 16, iswhite);
370 draw_knight(cr, 8, 8, 16, iswhite);
371 icon_str +=
"knight";
374 draw_bishop(cr, 8, 8, 16, iswhite);
375 icon_str +=
"bishop";
378 draw_queen(cr, 8, 8, 16, iswhite);
382 draw_king(cr, 8, 8, 16, iswhite);
387 Glib::RefPtr<Gdk::Pixbuf> icon_pixbuf = Gdk::Pixbuf::create(Glib::RefPtr<Gdk::Drawable>::cast_static(icon_pixmap), 0, 0, 16, 16);
388 M_refIconFactory->add(Gtk::StockID(icon_str.c_str()), Gtk::IconSet(icon_pixbuf));
390 do {
TypeData type_data = {
static_cast<uint8_t
>(type() + 1) }; type = type_data; }
while (type() == 4);
395 M_refActionGroup = Gtk::ActionGroup::create();
396 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceMenu",
"Placepiece Menu"));
397 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceBlackPawn", Gtk::StockID(
"black_pawn_icon"),
"Black Pawn"),
398 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_black_pawn));
399 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceBlackRook", Gtk::StockID(
"black_rook_icon"),
"Black Rook"),
400 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_black_rook));
401 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceBlackKnight", Gtk::StockID(
"black_knight_icon"),
"Black Knight"),
402 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_black_knight));
403 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceBlackBishop", Gtk::StockID(
"black_bishop_icon"),
"Black Bishop"),
404 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_black_bishop));
405 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceBlackQueen", Gtk::StockID(
"black_queen_icon"),
"Black Queen"),
406 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_black_queen));
407 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceBlackKing", Gtk::StockID(
"black_king_icon"),
"Black King"),
408 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_black_king));
409 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceWhitePawn", Gtk::StockID(
"white_pawn_icon"),
"White Pawn"),
410 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_white_pawn));
411 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceWhiteRook", Gtk::StockID(
"white_rook_icon"),
"White Rook"),
412 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_white_rook));
413 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceWhiteKnight", Gtk::StockID(
"white_knight_icon"),
"White Knight"),
414 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_white_knight));
415 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceWhiteBishop", Gtk::StockID(
"white_bishop_icon"),
"White Bishop"),
416 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_white_bishop));
417 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceWhiteQueen", Gtk::StockID(
"white_queen_icon"),
"White Queen"),
418 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_white_queen));
419 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceWhiteKing", Gtk::StockID(
"white_king_icon"),
"White King"),
420 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_white_king));
421 M_refActionGroup->add(Gtk::Action::create(
"PlacepieceNothing", Gtk::StockID(
"black_nothing_icon"),
"Clear square"),
422 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_placepiece_nothing));
423 M_refAllowEnPassantCapture_action = Gtk::ToggleAction::create(
"AllowEnPassantCapture",
"Allow e.p. capture");
424 M_refActionGroup->add(M_refAllowEnPassantCapture_action);
425 M_AllowEnPassantCapture_connection =
426 M_refAllowEnPassantCapture_action->signal_toggled().connect(sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_allow_en_passant_capture));
427 M_refPieceHasMoved_action = Gtk::ToggleAction::create(
"PieceHasMoved",
"Has moved");
428 M_refActionGroup->add(M_refPieceHasMoved_action);
429 M_PieceHasMoved_connection =
430 M_refPieceHasMoved_action->signal_toggled().connect(sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_piece_has_moved));
431 M_refActionGroup->add(Gtk::Action::create(
"CopyFEN", Gtk::Stock::COPY,
"Copy FEN"),
432 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_copy_FEN));
433 M_refActionGroup->add(Gtk::Action::create(
"PasteFEN", Gtk::Stock::PASTE,
"Paste FEN"),
434 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_paste_FEN));
435 M_refActionGroup->add(Gtk::Action::create(
"SwapColors",
"Swap colors"),
436 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_swap_colors));
437 M_refActionGroup->add(Gtk::Action::create(
"InitialPosition",
"Initial position"),
438 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_initial_position));
439 M_refActionGroup->add(Gtk::Action::create(
"ClearBoard",
"Clear board"),
440 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_clear_board));
441 Gtk::RadioAction::Group group_to_move;
442 M_refToMoveWhite_action = Gtk::RadioAction::create(group_to_move,
"ToMoveWhite",
"White to play");
443 M_refActionGroup->add(M_refToMoveWhite_action,
444 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_to_move_white));
445 M_refToMoveBlack_action = Gtk::RadioAction::create(group_to_move,
"ToMoveBlack",
"Black to play");
446 M_refActionGroup->add(M_refToMoveBlack_action,
447 sigc::mem_fun(*
this,& ChessPositionWidget::on_menu_to_move_black));
449 M_refUIManager = Gtk::UIManager::create();
450 M_refUIManager->insert_action_group(M_refActionGroup);
455 Glib::ustring ui_info =
457 " <popup name='PopupMenu'>" 458 " <menuitem action='PlacepieceWhitePawn'/>" 459 " <menuitem action='PlacepieceWhiteRook'/>" 460 " <menuitem action='PlacepieceWhiteKnight'/>" 461 " <menuitem action='PlacepieceWhiteBishop'/>" 462 " <menuitem action='PlacepieceWhiteQueen'/>" 463 " <menuitem action='PlacepieceWhiteKing'/>" 465 " <menuitem action='PlacepieceBlackPawn'/>" 466 " <menuitem action='PlacepieceBlackRook'/>" 467 " <menuitem action='PlacepieceBlackKnight'/>" 468 " <menuitem action='PlacepieceBlackBishop'/>" 469 " <menuitem action='PlacepieceBlackQueen'/>" 470 " <menuitem action='PlacepieceBlackKing'/>" 472 " <menuitem action='AllowEnPassantCapture'/>" 473 " <menuitem action='PieceHasMoved'/>" 474 " <menuitem action='PlacepieceNothing'/>" 476 " <menuitem action='ToMoveWhite'/>" 477 " <menuitem action='ToMoveBlack'/>" 479 " <menuitem action='CopyFEN'/>" 480 " <menuitem action='PasteFEN'/>" 481 " <menuitem action='SwapColors'/>" 482 " <menuitem action='InitialPosition'/>" 483 " <menuitem action='ClearBoard'/>" 486 #ifdef GLIBMM_EXCEPTIONS_ENABLED 489 M_refUIManager->add_ui_from_string(ui_info);
491 catch(
const Glib::Error& ex)
493 std::cerr <<
"building menus failed: " << ex.what();
496 std::auto_ptr<Glib::Error> ex;
497 M_refUIManager->add_ui_from_string(ui_info, ex);
500 std::cerr <<
"building menus failed: " << ex->what();
502 #endif //GLIBMM_EXCEPTIONS_ENABLED 505 M_MenuPopup =
dynamic_cast<Gtk::Menu*
>(M_refUIManager->get_widget(
"/PopupMenu"));
507 g_warning(
"menu not found");
509 M_MenuPopup->signal_deactivate().connect(sigc::mem_fun(
this,& ChessPositionWidget::popup_deactivated));
512 void ChessPositionWidget::popup_deactivated(
void)
514 Dout(dc::notice,
"Calling ChessPositionWidget::popup_deactivated()");
518 bool ChessPositionWidget::on_button_press_event(GdkEventButton* event)
521 if (debug::channels::dc::event.is_on())
522 Dout(dc::event,
"Entering ChessPositionWidget::on_button_press_event(" << event <<
")");
524 Dout(dc::notice|dc::clipboard,
"Entering ChessPositionWidget::on_button_press_event()");
525 debug::Indent __cwmm_chesspositionwidget_debug_indent(2);
529 gint col = x2col(event->x);
530 gint row = y2row(event->y);
533 if (!is_inside_board(col, row))
537 if (on_button_press(col, row, event))
542 if (event->type != GDK_BUTTON_PRESS ||
543 (M_widget_mode != mode_edit_position && M_widget_mode != mode_edit_game))
547 if (event->button == 1)
549 M_floating_piece_handle = -1;
550 code_t code = get_square(col, row);
556 if (M_widget_mode == mode_edit_position)
564 M_move_from =
Index(col, row);
565 if (piece_at(M_move_from).color() != to_move())
577 double hsside = 0.5 * sside();
578 double fraction = hsside - (gint)hsside;
579 M_floating_piece_handle = add_floating_piece(code, event->x - fraction, event->y - fraction, TRUE);
580 M_signal_picked_up.emit(M_move_from,*
this);
587 else if (event->button == 3 && M_widget_mode == mode_edit_position)
589 if (popup_menu(event, col, row))
597 bool ChessPositionWidget::on_button_release_event(GdkEventButton* event)
600 if (debug::channels::dc::event.is_on())
601 Dout(dc::event,
"Entering ChessPositionWidget::on_button_release_event(" << event <<
")");
603 Dout(dc::notice,
"Entering ChessPositionWidget::on_button_release_event()");
604 debug::Indent __cwmm_chesspositionwidget_debug_indent(2);
608 gint col = x2col(event->x);
609 gint row = y2row(event->y);
612 if (!is_inside_board(col, row))
614 if (on_button_release(col, row, event))
618 if (M_widget_mode != mode_edit_position && M_widget_mode != mode_edit_game)
622 if (event->button == 1 && M_floating_piece_handle != -1)
624 if (M_widget_mode == mode_edit_game || col != -1)
627 code_t code = get_floating_piece(M_floating_piece_handle);
628 if (M_widget_mode == mode_edit_position)
637 if (to == M_move_from || col == -1)
640 set_square(M_move_from.col(), M_move_from.row(), code);
649 move. set_promotion(M_promotion->type(
this, move));
654 M_signal_moved.emit(move, previous_position,*
this);
659 set_square(M_move_from.col(), M_move_from.row(), code);
660 M_signal_illegal.emit(move,*
this);
666 remove_floating_piece(M_floating_piece_handle);
667 M_floating_piece_handle = -1;
668 M_signal_dropped.emit(col, row,*
this);
CodeData const black_pawn
A constant representing a black pawn.
IndexData const index_begin
A constant representing the& #39;first' index.
A namespace for all chess related objects that are not related to the GUI.
bool load_FEN(std::string const& FEN)
Read a FEN code.
CwChessboardCode const empty_square
CodeData const white_queen
A constant representing a white queen.
bool execute(Move const& move)
Execute move move.
ColorData const white
A constant representing the color white.
IndexData const ia1
A constant representing the index to square a1.
IndexData const ih1
A constant representing the index to square h1.
A chess move in a particular chess position.
TypeData const pawn
A constant representing a pawn.
TypeData const king
A constant representing a king.
CodeData const black_queen
A constant representing a black queen;.
uint8_t const bishop_bits
The underlaying integral value of type& #39;bishop'.
IndexData const ih8
A constant representing the index to square h8.
IndexData const ia8
A constant representing the index to square a8.
The POD base type of class Index.
CodeData const black_rook
A constant representing a black rook;.
bool is_promotion(void) const
Return TRUE if this move is a pawn promotion.
An object representing en passant information.
The index of a chess square.
int col(void) const
Returns the column.
CodeData const white_rook
A constant representing a white rook.
A particular piece on the board.
Index index(void) const
Return the index of the square that was passed.
bool is_a(Type const& type) const
Returns TRUE if the type is equal.
uint8_t const king_bits
The underlaying integral value of type& #39;king'.
Index pawn_index(void) const
Return the index of the pawn that just advanced two squares.
CodeData const black_bishop
A constant representing a black bishop;.
Index from(void) const
Return the square the piece moves from.
int row(void) const
Returns the row.
Color color(void) const
Return the color of the piece.
A namespace for all gtkmm related objects.
A chess piece type including color.
Index to(void) const
Return the square the piece moves to.
CodeData const black_king
A constant representing a black king;.
TypeData const nothing
A constant representing the absence of a piece.
CodeData const white_pawn
A constant representing a white pawn.
bool exists(void) const
Return TRUE if the last move was a pawn advancing two squares.
CodeData const black_knight
A constant representing a black knight;.
A color (black or white).
CodeData const white_king
A constant representing a white king.
IndexData const index_end
A constant representing& #39;one past the end'.
IndexData const ie8
A constant representing the index to square e8.
uint8_t const knight_bits
The underlaying integral value of type& #39;knight'.
This file contains the definitions of the CwChessboardCode constants.
The POD base type of class Type.
uint8_t const queen_bits
The underlaying integral value of type& #39;queen'.
Type promotion_type(void) const
Return the promotion type. Returns empty if this isn't a promotion.
CodeData const white_bishop
A constant representing a white bishop.
CodeData const white_knight
A constant representing a white knight.
IndexData const ie1
A constant representing the index to square e1.
uint8_t const nothing_bits
The underlaying integral value of type& #39;nothing'.
uint8_t const pawn_bits
The underlaying integral value of type& #39;pawn'.
Code code(void) const
The code of this piece.
uint8_t const rook_bits
The underlaying integral value of type& #39;rook'.
ColorData const black
A constant representing the color black.