NAME

Games::Risk::Heap - poe session heap for Games::Risk

SYNOPSIS

POE::Session->create(
    [...]
    heap => Games::Risk::Heap->new,
    [...]
);

DESCRIPTION

This module implements a heap object, to be used in Games::Risk POE session. Furthermore, the non-event driven part of Games::Risk will be implemented as methods in this module.

METHODS

Constructor

  • my $heap = Games::Risk::Heap->new

    Create a new heap. No params needed.

Accessors

The following accessors (acting as mutators, ie getters and setters) are available for Games::Risk::Heap objects:

  • armies()

    armies left to be placed.

  • map()

    the current Games::Risk::Map object of the game.

Public methods

  • my @players = $heap->players()

    Return the Games::Risk::Player objects of the current game. Note that some of those players may have already lost.

  • my $player = $heap->players_next()

    Return the next player to play, or undef if the turn is over. Of course, players that have lost will never be returned.

  • $heap->players_reset()

    Mark all players to be in "turn to do", effectively marking them as still in play. Typically called during initial army placing, or real game start.

SEE ALSO

Games::Risk.

AUTHOR

Jerome Quelin, <jquelin at cpan.org>

COPYRIGHT & LICENSE

Copyright (c) 2008 Jerome Quelin, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU GPLv3+.