| 1 | package Games::Cards::Pair::Params; | ||
| 2 | |||
| 3 | 5 | $Games::Cards::Pair::Params::VERSION = '0.18'; | |
| 4 | 5 | $Games::Cards::Pair::Params::AUTHORITY = 'cpan:MANWAR'; | |
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | Games::Cards::Pair::Params - Placeholder for parameters for Games::Cards::Pair. | ||
| 9 | |||
| 10 | =head1 VERSION | ||
| 11 | |||
| 12 | Version 0.18 | ||
| 13 | |||
| 14 | =cut | ||
| 15 | |||
| 16 | 5 | ▶ | use 5.006; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 5 | ▶ | use strict; use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 5 | ▶ | use Data::Dumper; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 5 | ▶ | use Type::Library -base, -declare => qw(ZeroOrOne Suit Value Card Cards); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 5 | ▶ | use Types::Standard qw(Str InstanceOf ArrayRef); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | 5 | ▶ | use Type::Utils; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | |||
| 24 | 5 | my $SUITS = { 'C' => 1, 'D' => 1, 'H' => 1, 'S' => 1 }; | |
| 25 | 5 | my $VALUES = { '2' => 1, '3' => 1, '4' => 1, '5' => 1, | |
| 26 | '6' => 1, '7' => 1, '8' => 1, '9' => 1, | ||
| 27 | '10'=> 1, 'A' => 1, 'J' => 1, 'Q' => 1, | ||
| 28 | 'K' => 1, 'Joker' => 1 }; | ||
| 29 | |||
| 30 | declare 'ZeroOrOne', | ||
| 31 | as Str, | ||
| 32 | 7 | ▶ | where { /^[0|1]$/ }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 33 | 4 | ▶ | message { "ERROR: Only 0 or 1 allowed." }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 34 | |||
| 35 | declare 'Suit', | ||
| 36 | as Str, | ||
| 37 | 33 | ▶ | where { exists $SUITS->{ucfirst(lc($_[0]))} }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 38 | 2 | ▶ | message { "isa check for 'suit' failed." }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 39 | |||
| 40 | declare 'Value', | ||
| 41 | as Str, | ||
| 42 | 38 | ▶ | where { exists $VALUES->{ucfirst(lc($_[0]))} }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 43 | 2 | ▶ | message { "isa check for 'value' failed." }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 44 | |||
| 45 | 5 | declare 'Card', | |
| 46 | as InstanceOf['Games::Cards::Pair::Card']; | ||
| 47 | |||
| 48 | declare 'Cards', | ||
| 49 | as ArrayRef[Card], | ||
| 50 | 0 | ▶ | message { "isa check for 'cards' failed." }; |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 51 | |||
| 52 | =head1 AUTHOR | ||
| 53 | |||
| 54 | Mohammad S Anwar, C<< <mohammad.anwar at yahoo.com> >> | ||
| 55 | |||
| 56 | =head1 REPOSITORY | ||
| 57 | |||
| 58 | L<https://github.com/manwar/Games-Cards-Pair> | ||
| 59 | |||
| 60 | =head1 BUGS | ||
| 61 | |||
| 62 | Please report any bugs or feature requests to C<bug-games-cards-pair at rt.cpan.org>, | ||
| 63 | or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Cards-Pair>. | ||
| 64 | I will be notified and then you'll automatically be notified of progress on your | ||
| 65 | bug as I make changes. | ||
| 66 | |||
| 67 | =head1 SUPPORT | ||
| 68 | |||
| 69 | You can find documentation for this module with the perldoc command. | ||
| 70 | |||
| 71 | perldoc Games::Cards::Pair::Params | ||
| 72 | |||
| 73 | You can also look for information at: | ||
| 74 | |||
| 75 | =over 4 | ||
| 76 | |||
| 77 | =item * RT: CPAN's request tracker | ||
| 78 | |||
| 79 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Cards-Pair> | ||
| 80 | |||
| 81 | =item * AnnoCPAN: Annotated CPAN documentation | ||
| 82 | |||
| 83 | L<http://annocpan.org/dist/Games-Cards-Pair> | ||
| 84 | |||
| 85 | =item * CPAN Ratings | ||
| 86 | |||
| 87 | L<http://cpanratings.perl.org/d/Games-Cards-Pair> | ||
| 88 | |||
| 89 | =item * Search CPAN | ||
| 90 | |||
| 91 | L<http://search.cpan.org/dist/Games-Cards-Pair/> | ||
| 92 | |||
| 93 | =back | ||
| 94 | |||
| 95 | =head1 LICENSE AND COPYRIGHT | ||
| 96 | |||
| 97 | Copyright (C) 2012 - 2016 Mohammad S Anwar. | ||
| 98 | |||
| 99 | This program is free software; you can redistribute it and / or modify it under | ||
| 100 | the terms of the the Artistic License (2.0). You may obtain a copy of the full | ||
| 101 | license at: | ||
| 102 | |||
| 103 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||
| 104 | |||
| 105 | Any use, modification, and distribution of the Standard or Modified Versions is | ||
| 106 | governed by this Artistic License.By using, modifying or distributing the Package, | ||
| 107 | you accept this license. Do not use, modify, or distribute the Package, if you do | ||
| 108 | not accept this license. | ||
| 109 | |||
| 110 | If your Modified Version has been derived from a Modified Version made by someone | ||
| 111 | other than you,you are nevertheless required to ensure that your Modified Version | ||
| 112 | complies with the requirements of this license. | ||
| 113 | |||
| 114 | This license does not grant you the right to use any trademark, service mark, | ||
| 115 | tradename, or logo of the Copyright Holder. | ||
| 116 | |||
| 117 | This license includes the non-exclusive, worldwide, free-of-charge patent license | ||
| 118 | to make, have made, use, offer to sell, sell, import and otherwise transfer the | ||
| 119 | Package with respect to any patent claims licensable by the Copyright Holder that | ||
| 120 | are necessarily infringed by the Package. If you institute patent litigation | ||
| 121 | (including a cross-claim or counterclaim) against any party alleging that the | ||
| 122 | Package constitutes direct or contributory patent infringement,then this Artistic | ||
| 123 | License to you shall terminate on the date that such litigation is filed. | ||
| 124 | |||
| 125 | Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND | ||
| 126 | CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED | ||
| 127 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR | ||
| 128 | NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS | ||
| 129 | REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, | ||
| 130 | INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE | ||
| 131 | OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 132 | |||
| 133 | =cut | ||
| 134 | |||
| 135 | 5 | 1; # End of Games::Cards::Pair::Params | |