diff options
author | doy <doy@tozt.net> | 2009-01-16 01:48:00 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-01-16 01:48:00 -0500 |
commit | 2679a7f8be9668f1efb1dfbeb5d55325065ec12d (patch) | |
tree | c54a033c3f28241fc82b261f68236297721f2a05 | |
parent | 4531fcd737acc84ff1c7186519c446d2fa224e49 (diff) | |
download | bot-games-2679a7f8be9668f1efb1dfbeb5d55325065ec12d.tar.gz bot-games-2679a7f8be9668f1efb1dfbeb5d55325065ec12d.zip |
new syntax for declaring extra commands (typically generated methods) - still needs to be implemented
-rw-r--r-- | lib/Bot/Games/Game.pm | 2 | ||||
-rw-r--r-- | lib/Bot/Games/Game/Ghostlike.pm | 2 | ||||
-rw-r--r-- | lib/Bot/Games/OO.pm | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/Bot/Games/Game.pm b/lib/Bot/Games/Game.pm index d3f0a0c..ec82bd7 100644 --- a/lib/Bot/Games/Game.pm +++ b/lib/Bot/Games/Game.pm @@ -22,8 +22,8 @@ has players => ( count => 'num_players', }, command => 1, - commands => ['num_players'], ); +command 'num_players'; has start_time => ( is => 'ro', diff --git a/lib/Bot/Games/Game/Ghostlike.pm b/lib/Bot/Games/Game/Ghostlike.pm index 5337760..2505ddf 100644 --- a/lib/Bot/Games/Game/Ghostlike.pm +++ b/lib/Bot/Games/Game/Ghostlike.pm @@ -30,8 +30,8 @@ has challenger => ( isa => 'Str', predicate => 'has_challenger', command => 1, - commands => ['has_challenger'], ); +command 'has_challenger'; has wordlist => ( is => 'ro', diff --git a/lib/Bot/Games/OO.pm b/lib/Bot/Games/OO.pm index f5fb4cb..df78003 100644 --- a/lib/Bot/Games/OO.pm +++ b/lib/Bot/Games/OO.pm @@ -9,6 +9,7 @@ use Bot::Games::Meta::Method::Command; sub command { my $class = shift; my ($name, $code) = @_; + return unless $code; # XXX: fix this later my $method_meta = Bot::Games::Meta::Method::Command->wrap( $code, package_name => $class, |