Aion-Emitter

 view release on metacpan or  search on metacpan

t/aion/emitter.t  view on Meta::CPAN

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Emitter - диспетчер событий
# 
# # VERSION
# 
# 0.1.0
# 
# # SYNOPSIS
# 
# Файл lib/Event/BallEvent.pm:
#@> lib/Event/BallEvent.pm
#>> package Event::BallEvent;
#>> 
#>> use Aion;
#>> 
#>> has radius => (is => 'rw', isa => Num);
#>> has weight => (is => 'rw', isa => Num);
#>> 
#>> 1;
#@< EOF
# 
# Файл lib/Listener/RadiusListener.pm:
#@> lib/Listener/RadiusListener.pm
#>> package Listener::RadiusListener;
#>> 
#>> use Aion;
#>> 
#>> #@listen Event::BallEvent
#>> sub listen {
#>> 	my ($self, $event) = @_;
#>> 	
#>> 	$event->radius(10);
#>> }
#>> 
#>> 1;
#@< EOF
# 
# Файл lib/Listener/WeightListener.pm:
#@> lib/Listener/WeightListener.pm
#>> package Listener::WeightListener;
#>> 
#>> use Aion;
#>> 
#>> #@listen Event::BallEvent
#>> sub listen {
#>> 	my ($self, $event) = @_;
#>> 	
#>> 	$event->weight(12);
#>> }
#>> 
#>> #@listen Event::BallEvent#mini „Minimize version”
#>> sub minimize {
#>> 	my ($self, $event) = @_;
#>> 	
#>> 	$event->weight(3);
#>> }
#>> 
#>> 1;
#@< EOF



( run in 1.099 second using v1.01-cache-2.11-cpan-140bd7fdf52 )