summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/Game/Chess.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-06-02 18:52:25 -0500
committerJesse Luehrs <doy@tozt.net>2009-06-02 18:54:01 -0500
commit880dfe8177549891a31f1632821f6fdefbd69c4f (patch)
treea3585657d18a1370ef33ddf51b0f7186d59d44d0 /lib/Bot/Games/Game/Chess.pm
parent7d059870682438390ed816330259a8e23550bfcb (diff)
downloadbot-games-880dfe8177549891a31f1632821f6fdefbd69c4f.tar.gz
bot-games-880dfe8177549891a31f1632821f6fdefbd69c4f.zip
move maybe_add_player to the currentplayer role
Diffstat (limited to 'lib/Bot/Games/Game/Chess.pm')
-rw-r--r--lib/Bot/Games/Game/Chess.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Bot/Games/Game/Chess.pm b/lib/Bot/Games/Game/Chess.pm
index ad4549c..f196a09 100644
--- a/lib/Bot/Games/Game/Chess.pm
+++ b/lib/Bot/Games/Game/Chess.pm
@@ -29,7 +29,8 @@ has turn_count => (
augment turn => sub {
my $self = shift;
my ($player, $move) = @_;
- $self->add_player($player) unless $self->has_player($player);
+ $self->maybe_add_player($player);
+
return "The game has already begun between " . join ' and ', $self->players
unless $self->has_player($player);
return "It's not your turn"