summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/Game.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bot/Games/Game.pm')
-rw-r--r--lib/Bot/Games/Game.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Bot/Games/Game.pm b/lib/Bot/Games/Game.pm
index 24f4caa..6d0c29c 100644
--- a/lib/Bot/Games/Game.pm
+++ b/lib/Bot/Games/Game.pm
@@ -26,9 +26,20 @@ has players => (
push => 'add_player',
count => 'num_players',
},
+ curries => {
+ find => {
+ has_player => sub {
+ my $self = shift;
+ my $body = shift;
+ my ($player) = @_;
+ return $self->$body(sub { $_[0] eq $player }) ? 1 : 0;
+ },
+ },
+ },
command => 1,
);
command 'num_players';
+command 'has_player', formatter => sub { $_[0] ? 'true' : 'false' };
has start_time => (
is => 'ro',