1Games::Solitaire::VerifUys:e:rCaCrodn(t3r)ibuted Perl DoGcaummeesn:t:aStoilointaire::Verify::Card(3)
2
3
4

NAME

6       Games::Solitaire::Verify::Card - a class wrapper for an individual
7       Solitaire card.
8

VERSION

10       version 0.2403
11

SYNOPSIS

13           use Games::Solitaire::Verify::Card;
14
15           # Initialise a Queen-of-Hearts
16           my $queen_of_hearts = Games::Solitaire::Verify::Card->new(
17               {
18                   string => "QH",
19                   id => 4,
20                   data => { %DATA },
21               },
22           );
23

METHODS

25   $class->get_suits_seq()
26       Returns the expected sequence of the suits - "H", "S", "C", "D".
27
28   $class->calc_rank($rank_string)
29       Calculates the numerical rank of the string passed as argument.
30
31       Example:
32
33           my $ten = Games::Solitaire::Verify::Card->calc_rank("T")
34           # Prints 10.
35           print "$ten\n";
36
37   $class->calc_rank_with_0($rank_string)
38       Same as calc_rank only supporting "0" as the zero'th card.
39
40   $card->data()
41       Arbitrary data that is associated with the card. Can hold any scalar.
42
43   $card->id()
44       A simple identifier that identifies the card. Should be a string.
45
46   $card->rank()
47       Returns the rank of the card as an integer. Ace is 1, 2-10 are 2-10; J
48       is 11, Q is 12 and K is 13.
49
50   $card->suit()
51       Returns "H", "C", "D" or "S" depending on the suit.
52
53   $card->color()
54       Returns "red" or "black" depending on the rank of the card.
55
56   $card->color_for_suit($suit)
57       Get the color of the suit $suit (which may be different than the card's
58       suit).
59
60   my $copy = $card->clone();
61       Clones the card into a new copy.
62
63   $card->to_string()
64       Converts the card to a string representation.
65
66   $card->fast_s()
67       A cached string representation. (Use with care).
68
69   $class->rank_to_string($rank_idx)
70       Converts the rank to a string.
71
72   my [@ranks] = $class->get_ranks_strings()
73       Returns an (effectively constant) array reference of rank strings.
74
75       ( Added in version 0.17 .)
76
77   $card->is_flipped()
78       Determines if the card is flipped.
79
80   $card->set_flipped($flipped_bool)
81       Sets the cardXs flipped status.
82

SUPPORT

84   Websites
85       The following websites have more information about this module, and may
86       be of help to you. As always, in addition to those websites please use
87       your favorite search engine to discover more resources.
88
89       ·   MetaCPAN
90
91           A modern, open-source CPAN search engine, useful to view POD in
92           HTML format.
93
94           <https://metacpan.org/release/Games-Solitaire-Verify>
95
96       ·   RT: CPAN's Bug Tracker
97
98           The RT ( Request Tracker ) website is the default bug/issue
99           tracking system for CPAN.
100
101           <https://rt.cpan.org/Public/Dist/Display.html?Name=Games-Solitaire-Verify>
102
103       ·   CPANTS
104
105           The CPANTS is a website that analyzes the Kwalitee ( code metrics )
106           of a distribution.
107
108           <http://cpants.cpanauthors.org/dist/Games-Solitaire-Verify>
109
110       ·   CPAN Testers
111
112           The CPAN Testers is a network of smoke testers who run automated
113           tests on uploaded CPAN distributions.
114
115           <http://www.cpantesters.org/distro/G/Games-Solitaire-Verify>
116
117       ·   CPAN Testers Matrix
118
119           The CPAN Testers Matrix is a website that provides a visual
120           overview of the test results for a distribution on various
121           Perls/platforms.
122
123           <http://matrix.cpantesters.org/?dist=Games-Solitaire-Verify>
124
125       ·   CPAN Testers Dependencies
126
127           The CPAN Testers Dependencies is a website that shows a chart of
128           the test results of all dependencies for a distribution.
129
130           <http://deps.cpantesters.org/?module=Games::Solitaire::Verify>
131
132   Bugs / Feature Requests
133       Please report any bugs or feature requests by email to
134       "bug-games-solitaire-verify at rt.cpan.org", or through the web
135       interface at
136       <https://rt.cpan.org/Public/Bug/Report.html?Queue=Games-Solitaire-Verify>.
137       You will be automatically notified of any progress on the request by
138       the system.
139
140   Source Code
141       The code is open to the world, and available for you to hack on. Please
142       feel free to browse it and play with it, or whatever. If you want to
143       contribute patches, please send me a diff or prod me to pull from your
144       repository :)
145
146       <https://github.com/shlomif/fc-solve>
147
148         git clone git://github.com/shlomif/fc-solve.git
149

AUTHOR

151       Shlomi Fish <shlomif@cpan.org>
152

BUGS

154       Please report any bugs or feature requests on the bugtracker website
155       <https://github.com/shlomif/fc-solve/issues>
156
157       When submitting a bug or request, please include a test-file or a patch
158       to an existing test-file that illustrates the bug or desired feature.
159
161       This software is Copyright (c) 2008 by Shlomi Fish.
162
163       This is free software, licensed under:
164
165         The MIT (X11) License
166
167
168
169perl v5.32.0                      2020-07-28 Games::Solitaire::Verify::Card(3)
Impressum