The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Games::Risk::GUI::MoveArmies - window to move armies

VERSION

version 3.112820

DESCRIPTION

GR::GUI::MoveArmies implements a POE session, creating a Tk window to ask the number of armies to move between adjacent countries. Once used, the window is hidden to be reused later on.

SYNOPSYS

    my $id = Games::Risk::GUI::MoveArmies->spawn(%opts);
    Poe::Kernel->post( $id, 'attack_move', $src, $dst, $min );
    Poe::Kernel->post( $id, 'move_armies', $src, $dst, $max );

CLASS METHODS

my $id = Games::Risk::GUI::MoveArmies->spawn( %opts );

Create a window requesting for amies move, and return the associated POE session ID. One can pass the following options:

parent => $mw

A Tk window that will be the parent of the toplevel window created. This parameter is mandatory.

PUBLIC EVENTS

The newly created POE session accepts the following events:

attack_move( $src, $dst, $min )

Show window and request how many armies to move from $src to $dst. This number should be at least $min, matching the number of dices used for attack.

SEE ALSO

Games::Risk.

AUTHOR

Jerome Quelin

COPYRIGHT AND LICENSE

This software is Copyright (c) 2008 by Jerome Quelin.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007