NAME

Game::Dominoes::Boneyard - the undealt tiles, and the two nobody may draw

VERSION

Version 0.01

SYNOPSIS

use Game::Dominoes::Boneyard;

my $yard = Game::Dominoes::Boneyard->new(tiles => \@tiles);

$yard->count;      # 10, and this is public
$yard->drawable;   # 8, because the last two are reserved
$yard->can_draw;   # 1
my $tile = $yard->draw;

DESCRIPTION

The tiles nobody was dealt, in the order the seeded shuffle put them. Drawing takes from the front, so a whole hand is a pure function of the shuffle and this class never sees a seed.

The count is public and the tiles are not. That split is what makes dominoes worth adding to a site whose only hidden state has ever been a player's hand, and it is why peek carries a warning and count does not.

PROPERTIES

tiles

$yard->tiles;   # an arrayref of Game::Dominoes::Tile

What is left, in draw order. Not for a view.

reserve

$yard->reserve;   # 0

How many tiles at the back may never be drawn. Nought in All Fives, which is drawn to empty: a player who cannot play "must draw tiles from the boneyard until he has a tile to play or the boneyard is empty".

A reserve of one or two is a listed variation on the same page and the rule of the separate game Draw Dominoes, so it is an attribute rather than a constant. Set it and a player facing a boneyard of that size passes instead of drawing.

FUNCTIONS

count

$yard->count;   # 10

How many tiles are in the boneyard, the reserve included. This is public: a player at the table can see those tiles even though nobody may take them.

drawable

$yard->drawable;   # 8

How many may actually be taken, which is count less reserve, never below zero.

can_draw

$yard->can_draw;

Whether a draw would produce a tile.

is_empty

$yard->is_empty;

Whether there is nothing left at all, reserve included.

draw

my $tile = $yard->draw;

The next tile, or undef when only the reserve is left. Removes it.

peek

$yard->peek;   # an arrayref copy

What is left, without taking it, for the tests and for the terminal's replay mode. This must never reach a view.

pips

$yard->pips;

The pips still in the boneyard. Part of the running total that must always come to 168 across the hands, the boneyard and the layout.

SEE ALSO

Game::Dominoes::Set, where the order comes from.

AUTHOR

LNATION <email@lnation.org>

BUGS

Please report any bugs or feature requests to bug-game-dominoes at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Game-Dominoes.

SUPPORT

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

perldoc Game::Dominoes::Boneyard

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION <email@lnation.org>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)