NAME

Game::Cribbage::Round::Score - running score tracker for a round

VERSION

Version 0.12

SYNOPSIS

use Game::Cribbage::Round::Score;

my $score = Game::Cribbage::Round::Score->new(
	player1 => { current => 0, last => 0 },
	player2 => { current => 0, last => 0 },
);

# award 6 points to player1
$score->player1->{last}    = $score->player1->{current};
$score->player1->{current} += 6;

DESCRIPTION

Holds the cumulative per-player scores for a single Game::Cribbage::Round. Each player slot stores a hashref with two keys:

  • current - points earned so far in the round

  • last - points at the previous scoring event (used to detect a win)

PROPERTIES

player1

Read/write hashref holding the current and last score for player 1.

$score->player1->{current};
$score->player1->{last};

player2

Read/write hashref holding the current and last score for player 2.

$score->player2->{current};
$score->player2->{last};

player3

Read/write hashref holding the current and last score for player 3 in a three- or four-player game.

$score->player3->{current};

player4

Read/write hashref holding the current and last score for player 4 in a four-player game.

$score->player4->{current};

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)