From a5020cfdb1f6408654ff778a8d04cc39ac44f3ae Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 2 Jun 2009 21:16:02 -0500 Subject: add a command to check the current state of the game --- lib/Bot/Games/Game/Chess.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Bot/Games/Game/Chess.pm b/lib/Bot/Games/Game/Chess.pm index 25f550e..2f0adef 100644 --- a/lib/Bot/Games/Game/Chess.pm +++ b/lib/Bot/Games/Game/Chess.pm @@ -65,6 +65,16 @@ command resign => sub { nick => $args->{player}) }; +command state => sub { + my $self = shift; + my ($dummy, $args) = @_; + return $self->current_player + . ($self->game->to_move ? ' (white)' : ' (black)') + . ' to play: ' + . App::Nopaste::nopaste(text => $self->game->dump_pos, + nick => $args->{player}); +}; + sub format_turn { my $self = shift; my ($turn) = @_; -- cgit v1.2.3-54-g00ecf