NAME

Game::Mahjong::Fan - one scoring element: its number, points, sentence and checker

VERSION

Version 0.01

SYNOPSIS

my $fan = Game::Mahjong::Fans::by_key('mixed_triple_chow');
$fan->n;          # 41
$fan->points;     # 8
$fan->says;       # the rulebook's sentence
my @found = $fan->instances($view);   # each { sets => [indices] }

DESCRIPTION

A row of the eighty-one. The checker reads a view of one split of a hand ("view" in Game::Mahjong::Fans) and returns every instance of the fan it finds, each naming the sets it used, so the scorer can apply the account-once principle to the set-based fans and count the ones that score more than once (a flower, a pung of terminals) as many times as they occur.

ATTRIBUTES

n

The rulebook's number, 1 to 81.

key

The snake_case key the site's catalogue and the log use.

name

The rulebook's English name.

points

88, 64, 48, 32, 24, 16, 12, 8, 6, 4, 2 or 1.

says

The rulebook's sentence, verbatim, which xt/fans-cited.t finds in the fetched text.

excludes

Keys this fan does not combine with, transcribed from Appendix 1.

implies

Keys this fan inevitably includes, which the non-repeat principle drops.

check

The checker, a code reference taking a view.

special

Set for a fan the scorer applies itself rather than through the checker (Chicken Hand).

combining

1 for a fan made by combining two or more sets (the double and triple chows and pungs, the straights, the shifted runs, the four-set patterns): the account-once principle counts the sets these use. A fan that describes the whole hand (All Chows, Outside Hand) lists its sets for information and consumes none.

whole

1 for a fan that describes every set of the hand (All Pungs, All Chows, Outside Hand, All Types, and so on): true of a complete hand or not at all, so the bot's floor, which sees only the melds, never counts it.

METHODS

instances

The instances found in a view, each { sets => [indices], points => optional override }.

times

How many instances.

SEE ALSO

Game::Mahjong::Fans

AUTHOR

LNATION <email@lnation.org>

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.