This software features a read-only class that holds move data for Chess games. The class is utilized by Chess::Game::MoveList to keep track of a game's progress.
To create a new instance of Chess::Game::MoveListEntry, utilize the SYNOPSIS code below. The code creates an object that contains movement data of a pawn moving from square e2 to e4.
$entry = Chess::Game::MoveListEntry->new(1, $pawn, "e2", "e4", 0);
Once the object is created, you can obtain information about the movement of the chess piece stored in the object. The code below retrieves the move number, the piece moved, the starting square, the destination square, and whether the move was a capture, or castles.
$one = $entry->get_move_num();
$pawn = $entry->get_piece();
$e2 = $entry->get_start_square();
$e4 = $entry->get_dest_square();
$false = $entry->is_capture();
$false = $entry->is_short_castle();
$false = $entry->is_long_castle();
$false = $entry->is_en_passant();
Overall, Chess::Game::MoveListEntry is a valuable class when developing chess programs with Perl as it provides a framework for keeping track of moves made during a game.
Version 0.6.2: N/A