Jerome Quelin > Games-Risk-3.112820 > Games::Risk::Tk::Main

Download:
Games-Risk-3.112820.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 3.112820   Source   Latest Release: Games-Risk-4.000

NAME ^

Games::Risk::Tk::Main - main prisk window

VERSION ^

version 3.112820

DESCRIPTION ^

This class implements the whole Tk graphical interface. It is a POE session driving events, reacting to user interaction & updating the display as game changes status.

EVENTS ^

attack

    attack()

Request user to start attacking at will.

attack_info

    attack_info( $src, $dst, \@attack, \@defence )

Give the result of $dst attack from $src: @attack and @defence dices.

attack_move

    attack_move()

Prevent user to re-attack till he moved the armies.

chnum

chown

    chnum( $country )
    chown( $country )

Force $country to be redrawn: owner and number of armies.

flash_country

    flash_country( $country , [ $state, $left ] )

Request $country to be flashed on the map. This is done by extracting the country from the greyscale image, and paint it in white on the canvas.

Once the image is created, the event yields itself back after $FLASHDELAY, and shows/hides the image depending on $state. When $left hits 0 (decremented each state change), the image is discarded.

game_over

    game_over( $player )

Sent when $player has won the game.

move_armies

    move_armies()

Request user to move armies if she wants to.

move_armies_move

    move_armies_move($src, $dst, $nb)

Request gui to move $nb armies from $src to $dst.

new_game

    new_game()

Received when the controller started a new game. Display the new map, action & statusbar.

place_armies

    place_armies( $nb [, $continent] )

Request user to place $nb armies on her countries (maybe within $continent if supplied).

place_armies_initial

    place_armies_initial()

Request user to place 1 armies on her countries. this is initial reinforcement, so there's no limit on where to put the army, and armies are put one by one.

place_armies_initial_count

    place_armies_initial_count( $nb )

request user to place $nb armies on her countries. this is initial armies placement: - no restriction on where - armies get placed one by one

this event just allows the gui to inform user how many armies will be placed initially.

player_active

    player_active( $player )

Change player labels so that previous player is inactive, and new active one is $player.

player_add

    player_add( $player )

Create a label for $player, with tooltip information.

player_lost

    player_lost($player)

Mark $player as lost.

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
syntax highlighting: