| 1 | package Game::Mahjong::Meld; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 34 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 34 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 34 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 34 | ▶ | use Object::Proto::Sugar -types; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 34 | ▶ | use Game::Mahjong::Tiles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 34 | ▶ | use Game::Mahjong::Notation; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 34 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 34 | our %KIND; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 34 | ▶ | BEGIN { %KIND = (chow => 3, pung => 3, kong => 4) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 34 | has kind => (is => 'ro', isa => Str, required => 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 34 | has tiles => (is => 'ro', isa => ArrayRef, required => 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 34 | has concealed => (is => 'ro', default => 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 34 | has claimed_from => (is => 'ro'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 34 | has claimed_tile => (is => 'ro'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 34 | has promoted => (is => 'ro', default => 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 2496 | ▶ | sub BUILD { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=19 SCAR=29.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 2496 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 2496 | my $kind = $self->kind; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 2496 | ▶ | die "Game::Mahjong::Meld: no such kind '$kind'" unless $KIND{$kind}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2495 | my @tiles = sort { $a <=> $b } @{ $self->tiles }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | die "Game::Mahjong::Meld: a $kind is $KIND{$kind} tiles, not " . scalar @tiles | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2495 | ▶ | unless @tiles == $KIND{$kind}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2492 | Game::Mahjong::Tiles::code_of($_) for @tiles; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | die 'Game::Mahjong::Meld: a bonus tile is never in a meld' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 2491 | ▶ | if grep { Game::Mahjong::Tiles::is_bonus($_) } @tiles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 2490 | ▶ | if ($kind eq 'chow') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 1470 | my $suit = Game::Mahjong::Tiles::suit_of($tiles[0]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 1470 | ▶ | die 'Game::Mahjong::Meld: a chow is three consecutive tiles of one suit' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
defined $suit and $tiles[1] == $tiles[0] + 1 and $tiles[2] == $tiles[1] + 1 and Game::Mahjong::Tiles::rank_of($tiles[0]) <= 7
defined $suit and $tiles[1] == $tiles[0] + 1 and $tiles[2] == $tiles[1] + 1
defined $suit and $tiles[1] == $tiles[0] + 1
MC/DC75%3/4
defined $suit and $tiles[1] == $tiles[0] + 1 and $tiles[2] == $tiles[1] + 1 and Game::Mahjong::Tiles::rank_of($tiles[0]) <= 7
defined $suit
$tiles[1] == $tiles[0] + 1
$tiles[2] == $tiles[1] + 1
Game::Mahjong::Tiles::rank_of($tiles[0]) <= 7
Truth table80%4/5
A and B and C and D
A= defined $suitB= $tiles[1] == $tiles[0] + 1C= $tiles[2] == $tiles[1] + 1D= Game::Mahjong::Tiles::rank_of($tiles[0]) <= 7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | unless defined $suit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | && $tiles[1] == $tiles[0] + 1 && $tiles[2] == $tiles[1] + 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | && Game::Mahjong::Tiles::rank_of($tiles[0]) <= 7; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | die "Game::Mahjong::Meld: a $kind is identical tiles" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 1020 | ▶ | if grep { $_ != $tiles[0] } @tiles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 2486 | ▶ | die 'Game::Mahjong::Meld: a claimed meld names the tile it took' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->claimed_from and not defined $self->claimed_tile
MC/DC100%2/2
defined $self->claimed_from and not defined $self->claimed_tile
defined $self->claimed_from
not defined $self->claimed_tile
Truth table100%3/3
A and not(B)
A= defined $self->claimed_fromB= not defined $self->claimed_tile
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | if defined $self->claimed_from && !defined $self->claimed_tile; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | die 'Game::Mahjong::Meld: the claimed tile is not in the meld' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 2485 | ▶ | if defined $self->claimed_tile && !grep { $_ == $self->claimed_tile } @tiles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $self->claimed_tile and not grep({$_ == $self->claimed_tile;} @tiles)
MC/DC100%2/2
defined $self->claimed_tile and not grep({$_ == $self->claimed_tile;} @tiles)
defined $self->claimed_tile
not grep({$_ == $self->claimed_tile;} @tiles)
Truth table100%3/3
A and not(B)
A= defined $self->claimed_tileB= not grep({$_ == $self->claimed_tile;} @tiles)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 2484 | ▶ | die 'Game::Mahjong::Meld: a concealed meld was claimed from nobody' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->concealed and defined $self->claimed_from
MC/DC100%2/2
$self->concealed and defined $self->claimed_from
$self->concealed
defined $self->claimed_from
Truth table100%3/3
A and B
A= $self->concealedB= defined $self->claimed_from
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | if $self->concealed && defined $self->claimed_from; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 2483 | ▶ | die 'Game::Mahjong::Meld: only a kong is promoted' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->promoted and $kind ne "kong"
MC/DC100%2/2
$self->promoted and $kind ne "kong"
$self->promoted
$kind ne "kong"
Truth table100%3/3
A and B
A= $self->promotedB= $kind ne "kong"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | if $self->promoted && $kind ne 'kong'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 2482 | @{ $self->tiles } = @tiles; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 2482 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | ▶ | sub is_chow { return $_[0]->kind eq 'chow' ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_chow: called CC=2 SCAR=7.6
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 1954 | ▶ | sub is_pung { return $_[0]->kind eq 'chow' ? 0 : 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_pung: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 4 | ▶ | sub is_kong { return $_[0]->kind eq 'kong' ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_kong: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 2 | ▶ | sub size { return scalar @{ $_[0]->tiles } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
size: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 2 | ▶ | sub counts_as { return 3 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
counts_as: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 18826 | ▶ | sub tile { return $_[0]->tiles->[0] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
tile: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 2 | ▶ | sub suit { return Game::Mahjong::Tiles::suit_of($_[0]->tiles->[0]) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
suit: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 2 | ▶ | sub rank { return Game::Mahjong::Tiles::rank_of($_[0]->tiles->[0]) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rank: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 6 | ▶ | sub is_honour { return Game::Mahjong::Tiles::is_honour($_[0]->tiles->[0]) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_honour: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 6 | ▶ | sub has_terminal { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_terminal: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 6 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 6 | ▶ | return (grep { Game::Mahjong::Tiles::is_terminal($_) } @{ $self->tiles }) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 4 | ▶ | sub is_outside { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_outside: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 4 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 4 | ▶ | return $self->is_honour || $self->has_terminal ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->is_honour or $self->has_terminal
MC/DC100%2/2
$self->is_honour or $self->has_terminal
$self->is_honour
$self->has_terminal
Truth table100%3/3
A or B
A= $self->is_honourB= $self->has_terminal
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 2 | ▶ | sub is_exposed { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_exposed: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 2 | ▶ | return $self->concealed ? 0 : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 45 | ▶ | sub promote { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
promote: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 45 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 45 | ▶ | die 'Game::Mahjong::Meld: only an exposed pung is promoted to a kong' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->kind eq "pung" and not $self->concealed
MC/DC100%2/2
$self->kind eq "pung" and not $self->concealed
$self->kind eq "pung"
not $self->concealed
Truth table100%3/3
A and not(B)
A= $self->kind eq "pung"B= not $self->concealed
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | unless $self->kind eq 'pung' && !$self->concealed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | return ref($self)->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | kind => 'kong', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 42 | tiles => [ @{ $self->tiles }, $self->tile ], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | claimed_from => $self->claimed_from, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | claimed_tile => $self->claimed_tile, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | promoted => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 4 | ▶ | sub equals { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
equals: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 4 | my ($self, $other) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 4 | ▶ | return 0 unless ref $other && $other->can('kind'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $other and $other->can("kind")
MC/DC50%1/2
ref $other and $other->can("kind")
ref $other
$other->can("kind")
Truth table66%2/3
A and B
A= ref $otherB= $other->can("kind")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | return $self->kind eq $other->kind | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | && $self->concealed == $other->concealed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 3 | ▶ | && join(',', @{ $self->tiles }) eq join(',', @{ $other->tiles }) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$self->kind eq $other->kind and $self->concealed == $other->concealed and join(",", @{$self->tiles;}) eq join(",", @{$other->tiles;})
$self->kind eq $other->kind and $self->concealed == $other->concealed
MC/DC66%2/3
$self->kind eq $other->kind and $self->concealed == $other->concealed and join(",", @{$self->tiles;}) eq join(",", @{$other->tiles;})
$self->kind eq $other->kind
$self->concealed == $other->concealed
join(",", @{$self->tiles;}) eq join(",", @{$other->tiles;})
Truth table75%3/4
A and B and C
A= $self->kind eq $other->kindB= $self->concealed == $other->concealedC= join(",", @{$self->tiles;}) eq join(",", @{$other->tiles;})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 27 | ▶ | sub to_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_hash: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 27 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | kind => $self->kind, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 27 | ▶ | tiles => [ @{ $self->tiles } ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | concealed => $self->concealed ? 1 : 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 8 | ▶ | sub to_notation { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_notation: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 8 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 8 | return Game::Mahjong::Notation::print_meld($self->to_hash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 34 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||