Chess::Game::MoveListEntry - a read-only class containing move data, used by Chess::Game::MoveList to record a game.
$entry = Chess::Game::MoveListEntry->new(1, $pawn, "e2", "e4", 0); $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();
The Chess module provides a framework for writing chess programs with Perl. This class forms part of that framework, containing object data about a single move.
Constructs a new MoveListEntry with the provided parameters. Requires four scalar parameters containing move number, piece, start square and destination square. Optionally takes a fifth parameter containing flags for the entry. The following flags are recognized (but there are no exported constants for them):
MOVE_CAPTURE == 0x01 MOVE_CASTLE_SHORT == 0x02 MOVE_CASTLE_LONG == 0x04 MOVE_EN_PASSANT == 0x08 $entry = Chess::Game::MoveListEntry->new(1, $pawn, "e2", "e4", 0);
There are no class methods for this class.
Takes no parameters. Returns true if the entry was recorded as an 'en passant' capture. /"is_capture()" will also return true in this case.
The program uses a reference to a MoveListEntry that was not obtained by calling /"new()". Ensure that all MoveListEntries in the program were obtained either in this fashion, or through the container class, Chess::Game::MoveList, and that the reference refers to a defined value.
Please report any bugs to the author.
Brian Richardson <email@example.com>
Copyright (c) 2002, 2005 Brian Richardson. All rights reserved. This module is Free Software. It may be modified and redistributed under the same terms as Perl itself.