Games::Risk::Tk::Main - main prisk window
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.
Request user to start attacking at will.
attack_info( $src, $dst, \@attack, \@defence )
Give the result of
$dst attack from
Prevent user to re-attack till he moved the armies.
chnum( $country ) chown( $country )
$country to be redrawn: owner and number of armies.
flash_country( $country , [ $state, $left ] )
$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
$left hits 0 (decremented each state change), the image is discarded.
game_over( $player )
$player has won the game.
Request user to move armies if she wants to.
move_armies_move($src, $dst, $nb)
Request gui to move
$nb armies from
Received when the controller started a new game. Display the new map, action & statusbar.
place_armies( $nb [, $continent] )
Request user to place
$nb armies on her countries (maybe within
$continent if supplied).
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( $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 )
Change player labels so that previous player is inactive, and new active one is
player_add( $player )
Create a label for
$player, with tooltip information.
$player as lost.
This software is Copyright (c) 2008 by Jerome Quelin.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007