From b0223acdfe64b78e65c8f1a801763ea7bc4f3197 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 2 Jun 2009 20:54:01 -0500 Subject: add a resign command for chess --- lib/Bot/Games/Game/Chess.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Bot/Games/Game/Chess.pm b/lib/Bot/Games/Game/Chess.pm index f196a09..25f550e 100644 --- a/lib/Bot/Games/Game/Chess.pm +++ b/lib/Bot/Games/Game/Chess.pm @@ -56,6 +56,15 @@ around allow_new_player => sub { return $self->$orig(@_); }; +command resign => sub { + my $self = shift; + my ($dummy, $args) = @_; + $self->is_active(0); + return "$args->{player} resigns: " + . App::Nopaste::nopaste(text => $self->game->dump_pos, + nick => $args->{player}) +}; + sub format_turn { my $self = shift; my ($turn) = @_; -- cgit v1.2.3