summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-10-31 15:25:24 -0500
committerJesse Luehrs <doy@tozt.net>2009-10-31 15:28:04 -0500
commit5af5428d564bb0c0748ddac21fa5823c1c19f965 (patch)
tree6761e5d781d49d2a07a10c595a0a01af6c6ccbdd
parent188ad8e49c1fa2802eaa55b3d4ae978f2c58c23c (diff)
downloadbot-games-5af5428d564bb0c0748ddac21fa5823c1c19f965.tar.gz
bot-games-5af5428d564bb0c0748ddac21fa5823c1c19f965.zip
remove mx-ah
-rw-r--r--dist.ini1
-rw-r--r--lib/Bot/Games/Game.pm25
-rw-r--r--lib/Bot/Games/Game/Chess.pm6
-rw-r--r--lib/Bot/Games/OO.pm1
-rw-r--r--lib/Bot/Games/OO/Role.pm1
5 files changed, 13 insertions, 21 deletions
diff --git a/dist.ini b/dist.ini
index 56a947e..3d6f947 100644
--- a/dist.ini
+++ b/dist.ini
@@ -12,7 +12,6 @@ IM::Engine::Plugin::Commands = 0
DateTime = 0
Math::Expression::Evaluator = 0
Module::Pluggable = 0
-MooseX::AttributeHelpers = 0.18_01
Moose = 0.64
List::Util = 1.05
Games::Word = 0.04
diff --git a/lib/Bot/Games/Game.pm b/lib/Bot/Games/Game.pm
index a9d0862..651a180 100644
--- a/lib/Bot/Games/Game.pm
+++ b/lib/Bot/Games/Game.pm
@@ -2,31 +2,26 @@ package Bot::Games::Game;
use Bot::Games::OO;
use DateTime;
use Time::Duration;
+use List::MoreUtils qw(any);
has players => (
- traits => ['MooseX::AttributeHelpers::Trait::Collection::Array'],
+ traits => [qw(Array)],
is => 'ro',
isa => 'ArrayRef[Str]',
auto_deref => 1,
default => sub { [] },
- provides => {
- 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;
- },
- },
+ handles => {
+ add_player => 'push',
+ num_players => 'count',
},
command => 1,
);
command 'num_players';
-command 'has_player', formatter => 'Bool';
+command has_player => sub {
+ my $self = shift;
+ my ($player) = @_;
+ return any { $_ eq $player } $self->players;
+}, formatter => 'Bool';
has start_time => (
is => 'ro',
diff --git a/lib/Bot/Games/Game/Chess.pm b/lib/Bot/Games/Game/Chess.pm
index c3eb14f..d689785 100644
--- a/lib/Bot/Games/Game/Chess.pm
+++ b/lib/Bot/Games/Game/Chess.pm
@@ -17,12 +17,12 @@ has game => (
);
has turn_count => (
- traits => ['MooseX::AttributeHelpers::Trait::Counter'],
+ traits => [qw(Counter)],
is => 'ro',
isa => 'Int',
default => 1,
- provides => {
- inc => 'inc_turn',
+ handles => {
+ inc_turn => 'inc',
}
);
diff --git a/lib/Bot/Games/OO.pm b/lib/Bot/Games/OO.pm
index 119718d..0131a1a 100644
--- a/lib/Bot/Games/OO.pm
+++ b/lib/Bot/Games/OO.pm
@@ -1,6 +1,5 @@
package Bot::Games::OO;
use IM::Engine::Plugin::Commands::OO ();
-use MooseX::AttributeHelpers;
use Moose::Exporter;
Moose::Exporter->setup_import_methods(
diff --git a/lib/Bot/Games/OO/Role.pm b/lib/Bot/Games/OO/Role.pm
index 43bcf4f..22ee5c0 100644
--- a/lib/Bot/Games/OO/Role.pm
+++ b/lib/Bot/Games/OO/Role.pm
@@ -1,6 +1,5 @@
package Bot::Games::OO::Role;
use IM::Engine::Plugin::Commands::OO::Role ();
-use MooseX::AttributeHelpers;
use Moose::Exporter;
Moose::Exporter->setup_import_methods(