summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-01-25 17:48:29 -0500
committerdoy <doy@tozt.net>2009-01-25 17:48:29 -0500
commitd9b0b9b5de58441bfc7021815b34beea0843370d (patch)
treebab9e67bf40aeaf1b4e625b20159d6cd71a98f41
parent1d02e6ff28fe98fc5f80ff7c5abbab27d4bd1476 (diff)
downloadbot-games-d9b0b9b5de58441bfc7021815b34beea0843370d.tar.gz
bot-games-d9b0b9b5de58441bfc7021815b34beea0843370d.zip
reorganizing
-rw-r--r--lib/Bot/Games.pm48
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/Bot/Games.pm b/lib/Bot/Games.pm
index c478cd6..a3b0112 100644
--- a/lib/Bot/Games.pm
+++ b/lib/Bot/Games.pm
@@ -27,30 +27,6 @@ has done_init => (
default => sub { {} },
);
-sub _get_command {
- my ($game, $action) = @_;
- my $method_meta = $game->meta->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::Meta::Role::Command');
-}
-
-sub _add_method {
- my $class = shift;
- my ($name, $meth) = @_;
- return if ($class->meta->get_method($name));
- if ($class->meta->is_immutable) {
- my %immutable_opts = %{ $class->meta->get_immutable_options };
- $class->meta->make_mutable;
- $class->meta->add_method($name => $meth);
- $class->meta->make_immutable(%immutable_opts);
- }
- else {
- $class->meta->add_method($name => $meth);
- }
-}
-
sub said {
my $self = shift;
my ($args) = @_;
@@ -146,6 +122,30 @@ sub _format {
return $to_print;
}
+sub _get_command {
+ my ($game, $action) = @_;
+ my $method_meta = $game->meta->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::Meta::Role::Command');
+}
+
+sub _add_method {
+ my $class = shift;
+ my ($name, $meth) = @_;
+ return if ($class->meta->get_method($name));
+ if ($class->meta->is_immutable) {
+ my %immutable_opts = %{ $class->meta->get_immutable_options };
+ $class->meta->make_mutable;
+ $class->meta->add_method($name => $meth);
+ $class->meta->make_immutable(%immutable_opts);
+ }
+ else {
+ $class->meta->add_method($name => $meth);
+ }
+}
+
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
no Bot::Games::OO;