Games::Risk::Tk::Cards - cards listing


Games-Risk documentation  | view source Contained in the Games-Risk distribution.

Index


NAME

Top

Games::Risk::Tk::Cards - cards listing

VERSION

Top

version 3.103040

DESCRIPTION

Top

GR::Tk::Cards implements a POE session, creating a Tk window to list the cards the player got. It can be used to exchange cards with new armies during reinforcement.

METHODS

Top

card_add

    $K->post( cards => 'card_add', $card );

Player just received a new $card, display it.

card_del

    $K->post( cards => 'card_del', @cards );

Player just exchanged some @cards, remove them.

attack

    $K->post( cards => 'attack' );

Prevent user to exchange armies.

place_armies

    $K->post( cards => 'place_armies' );

Change exchange button state depending on the cards selected.

shutdown

    $K->post( 'gui-continents' => 'shutdown' );

Kill current session. The toplevel window has already been destroyed.

visibility_toggle

    $K->post( 'gui-continents' => 'visibility_toggle' );

Request window to be hidden / shown depending on its previous state.

SYNOPSYS

Top

    Games::Risk::Tk::Cards->new(%opts);

CLASS METHODS

Top

my $id = Games::Risk::Tk::Cards->spawn( %opts );

Create a window listing player cards, 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

Top

The newly created POE session accepts the following events:

* card_add( $card )

Add $card to the list of cards owned by the player to be shown.

* card_del( $card )

Remove $card from the list of cards owned by the player to be shown.

* visibility_toggle()

Request window to be hidden / shown depending on its previous state.

SEE ALSO

Top

Games::Risk.

AUTHOR

Top

  Jerome Quelin

COPYRIGHT AND LICENSE

Top


Games-Risk documentation  | view source Contained in the Games-Risk distribution.