Games-Risk

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

    "Exporter" => 0,
    "Exporter::Lite" => 0,
    "File::Basename" => 0,
    "File::Copy" => 0,
    "File::HomeDir::PathClass" => 0,
    "File::ShareDir::PathClass" => 0,
    "File::Spec::Functions" => 0,
    "Find::Lib" => 0,
    "FindBin" => 0,
    "Hash::NoRef" => 0,
    "Image::Magick" => 0,
    "Image::Size" => 0,
    "List::AllUtils" => 0,
    "List::MoreUtils" => 0,
    "List::Util" => 0,
    "Locale::TextDomain" => 0,
    "MIME::Base64" => 0,
    "Module::Pluggable::Object" => 0,
    "Moose" => "0.92",
    "Moose::Util::TypeConstraints" => 0,
    "MooseX::Aliases" => 0,

META.json  view on Meta::CPAN

            "Exporter" : "0",
            "Exporter::Lite" : "0",
            "File::Basename" : "0",
            "File::Copy" : "0",
            "File::HomeDir::PathClass" : "0",
            "File::ShareDir::PathClass" : "0",
            "File::Spec::Functions" : "0",
            "Find::Lib" : "0",
            "FindBin" : "0",
            "Hash::NoRef" : "0",
            "Image::Magick" : "0",
            "Image::Size" : "0",
            "List::AllUtils" : "0",
            "List::MoreUtils" : "0",
            "List::Util" : "0",
            "Locale::TextDomain" : "0",
            "MIME::Base64" : "0",
            "Module::Pluggable::Object" : "0",
            "Moose" : "0.92",
            "Moose::Util::TypeConstraints" : "0",
            "MooseX::Aliases" : "0",

META.yml  view on Meta::CPAN

  Exporter: '0'
  Exporter::Lite: '0'
  File::Basename: '0'
  File::Copy: '0'
  File::HomeDir::PathClass: '0'
  File::ShareDir::PathClass: '0'
  File::Spec::Functions: '0'
  Find::Lib: '0'
  FindBin: '0'
  Hash::NoRef: '0'
  Image::Magick: '0'
  Image::Size: '0'
  List::AllUtils: '0'
  List::MoreUtils: '0'
  List::Util: '0'
  Locale::TextDomain: '0'
  MIME::Base64: '0'
  Module::Pluggable::Object: '0'
  Moose: '0.92'
  Moose::Util::TypeConstraints: '0'
  MooseX::Aliases: '0'

lib/Games/Risk/Tk/Main.pm  view on Meta::CPAN

#   The GNU General Public License, Version 3, June 2007
#
use 5.010;
use strict;
use warnings;

package Games::Risk::Tk::Main;
# ABSTRACT: main prisk window
$Games::Risk::Tk::Main::VERSION = '4.000';
use POE          qw{ Loop::Tk };
use Image::Magick;
use Image::Size  qw{ imgsize };
use List::Util   qw{ min };
use MIME::Base64 qw{ encode_base64 };
use Moose;
use MooseX::Has::Sugar;
use MooseX::POE;
use MooseX::SemiAffordanceAccessor;
use Readonly;
use Tk;
use Tk::Action;

lib/Games/Risk/Tk/Main.pm  view on Meta::CPAN




    event flash_country => sub {
        my ($self, $country, $on, $left) = @_[OBJECT, ARG0 .. $#_];
        my $c = $self->_w('canvas');

        # first time that the country is flashed
        if ( not defined $on ) {
            # load greyscale image...
            my $magick = Image::Magick->new;
            $magick->Read( Games::Risk->new->map->greyscale );

            # and paint everything that isn't the country in white
            my $id = $country->id;
            my $grey = "rgb($id,$id,$id)";
            $magick->FloodfillPaint(fuzz=>0, fill=>'white', bordercolor=>$grey, invert=>1);
            $magick->Negate;                        # turn white in black
            $magick->Transparent( color=>'black' ); # mark black as transparent

            # resize the image to fit canvas zoom

lib/Games/Risk/Tk/Main.pm  view on Meta::CPAN

    # with ($w, $h). note that reconfigure is also window motion.
    event _canvas_configure => sub {
        my ($self, $args) = @_[OBJECT, ARG1];
        my ($c, $neww, $newh) = @$args;

        # check if we're at startup screen...
        my $map = Games::Risk->new->map;
        if ( defined $map ) {
            # in a game
            # create a new image resized to fit new dims
            my $magick = Image::Magick->new;
            $magick->Read( $map->background );
            $magick->Scale(width=>$neww, height=>$newh);

            # install this new image inplace of previous background
            my $img = $c->Photo( -data => encode_base64( $magick->ImageToBlob ) );
            $c->delete('background');
            $c->createImage(0, 0, -anchor=>'nw', -image=>$img, -tags=>['background']);
            $c->lower('background', 'all');

            # update zoom factors. note that we don't want to resize greyscale

t/000-report-versions-tiny.t  view on Meta::CPAN

eval { $v .= pmver('File::Copy','any version') };
eval { $v .= pmver('File::HomeDir::PathClass','any version') };
eval { $v .= pmver('File::ShareDir::PathClass','any version') };
eval { $v .= pmver('File::Spec','any version') };
eval { $v .= pmver('File::Spec::Functions','any version') };
eval { $v .= pmver('Find::Lib','any version') };
eval { $v .= pmver('FindBin','any version') };
eval { $v .= pmver('Hash::NoRef','any version') };
eval { $v .= pmver('IO::Handle','any version') };
eval { $v .= pmver('IPC::Open3','any version') };
eval { $v .= pmver('Image::Magick','any version') };
eval { $v .= pmver('Image::Size','any version') };
eval { $v .= pmver('List::AllUtils','any version') };
eval { $v .= pmver('List::MoreUtils','any version') };
eval { $v .= pmver('List::Util','any version') };
eval { $v .= pmver('Locale::TextDomain','any version') };
eval { $v .= pmver('MIME::Base64','any version') };
eval { $v .= pmver('Module::Build','0.3601') };
eval { $v .= pmver('Module::Pluggable::Object','any version') };
eval { $v .= pmver('Moose','0.92') };
eval { $v .= pmver('Moose::Util::TypeConstraints','any version') };



( run in 1.202 second using v1.01-cache-2.11-cpan-beeb90c9504 )