Games::Risk::Tk::Main - main prisk window
version 3.112820
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.
attack()
Request user to start attacking at will.
attack_info( $src, $dst, \@attack, \@defence )
Give the result of $dst attack from $src: @attack and @defence dices.
$dst
$src
@attack
@defence
attack_move()
Prevent user to re-attack till he moved the armies.
chnum( $country ) chown( $country )
Force $country to be redrawn: owner and number of armies.
$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.
$FLASHDELAY
$state
$left
game_over( $player )
Sent when $player has won the game.
$player
move_armies()
Request user to move armies if she wants to.
move_armies_move($src, $dst, $nb)
Request gui to move $nb armies from $src to $dst.
$nb
new_game()
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).
$continent
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( $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.
player_add( $player )
Create a label for $player, with tooltip information.
player_lost($player)
Mark $player as lost.
Jerome Quelin
This software is Copyright (c) 2008 by Jerome Quelin.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
To install Games::Risk, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Risk
CPAN shell
perl -MCPAN -e shell install Games::Risk
For more information on module installation, please visit the detailed CPAN module installation guide.