summaryrefslogtreecommitdiffstats
path: root/lib/Bot/Games/Trait/Class/Command.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-10-31 15:16:49 -0500
committerJesse Luehrs <doy@tozt.net>2009-10-31 15:28:04 -0500
commit188ad8e49c1fa2802eaa55b3d4ae978f2c58c23c (patch)
tree89333ab23955cceb45dada36ffe89a7a23c855b3 /lib/Bot/Games/Trait/Class/Command.pm
parentda36dca6178721b1c91b5e680d01e2595c2b1801 (diff)
downloadbot-games-188ad8e49c1fa2802eaa55b3d4ae978f2c58c23c.tar.gz
bot-games-188ad8e49c1fa2802eaa55b3d4ae978f2c58c23c.zip
convert Bot::Games to use IM::Engine::Plugin::Commands
Diffstat (limited to 'lib/Bot/Games/Trait/Class/Command.pm')
-rw-r--r--lib/Bot/Games/Trait/Class/Command.pm33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/Bot/Games/Trait/Class/Command.pm b/lib/Bot/Games/Trait/Class/Command.pm
deleted file mode 100644
index 8e70200..0000000
--- a/lib/Bot/Games/Trait/Class/Command.pm
+++ /dev/null
@@ -1,33 +0,0 @@
-package Bot::Games::Trait::Class::Command;
-use Bot::Games::OO::Role;
-
-after ((map { "add_${_}_method_modifier" } qw/before after around/) => sub {
- my $self = shift;
- my $name = shift;
-
- my $method_meta = $self->get_method($name);
- my $orig_method_meta = $method_meta->get_original_method;
- return unless $orig_method_meta->meta->can('does_role')
- && $orig_method_meta->meta->does_role('Bot::Games::Trait::Method::Command');
- my $pass_args = $orig_method_meta->pass_args;
- my $method_metaclass = Moose::Meta::Class->create_anon_class(
- superclasses => [blessed $method_meta],
- roles => ['Bot::Games::Trait::Method::Command'],
- cache => 1,
- );
- $method_metaclass->rebless_instance($method_meta, pass_args => $pass_args);
-});
-
-sub get_command {
- my $self = shift;
- my ($action) = @_;
- my $method_meta = $self->find_method_by_name($action);
- return $method_meta
- if blessed($method_meta)
- && $method_meta->meta->can('does_role')
- && $method_meta->meta->does_role('Bot::Games::Trait::Method::Command');
-}
-
-no Bot::Games::OO::Role;
-
-1;