NAME

Game::Cribbage::Rounds - collection of rounds for a full cribbage game

VERSION

Version 0.12

SYNOPSIS

use Game::Cribbage::Rounds;

my $rounds = Game::Cribbage::Rounds->new(number => 1);

$rounds->next_round($game);

my $round = $rounds->current_round;

DESCRIPTION

Manages the sequence of Game::Cribbage::Round objects that make up a complete game. Enforces the maximum round count and tracks which round is currently in progress.

PROPERTIES

number

Readonly integer property holding the total number of rounds allowed in the game. Attempting to start more rounds than this limit raises an exception.

$rounds->number;

history

Read/write arrayref of all Game::Cribbage::Round objects played so far, in order from first to most recent.

$rounds->history;

current_round

Read/write property holding the active Game::Cribbage::Round object.

$rounds->current_round;

FUNCTIONS

next_round

Creates a new Game::Cribbage::Round, initialises it for $game, pushes it onto history, and sets it as current_round. Accepts optional named arguments (e.g. id) that are forwarded to the Round constructor. Dies if the round limit has already been reached.

$rounds->next_round($game);
$rounds->next_round($game, id => 42);

AUTHOR

LNATION, <email at lnation.org>

BUGS

Please report any bugs or feature requests to bug-game-cribbage at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Game-Cribbage. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Game::Cribbage

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2024 by LNATION.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)