diff options
Diffstat (limited to 'lib/Bot/Games/OO/Game/Role.pm')
-rw-r--r-- | lib/Bot/Games/OO/Game/Role.pm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/Bot/Games/OO/Game/Role.pm b/lib/Bot/Games/OO/Game/Role.pm new file mode 100644 index 0000000..8aee3a4 --- /dev/null +++ b/lib/Bot/Games/OO/Game/Role.pm @@ -0,0 +1,28 @@ +package Bot::Games::OO::Game::Role; +use Bot::Games::OO::Role (); + +# XXX: is there a better way to go about this? +*command = \&Bot::Games::OO::Game::command; +Moose::Exporter->setup_import_methods( + with_caller => ['command'], + also => ['Bot::Games::OO::Role'], +); + +sub init_meta { + shift; + my %options = @_; + Moose::Role->init_meta(%options); + Moose::Util::MetaRole::apply_metaclass_roles( + for_class => + $options{for_class}, + attribute_metaclass_roles => + ['Bot::Games::Trait::Attribute::Command', + 'Bot::Games::Trait::Attribute::Formatted'], + metaclass_roles => + ['Bot::Games::Trait::Class::Command', + 'Bot::Games::Trait::Class::Formatted'], + ); + return $options{for_class}->meta; +} + +1; |