NAME

App::Tarotplane::Cards - Read tarotplane card files

SYNOPSIS

use App::Tarotplane::Cards;

$deck = App::Tarotplane::Cards->new(@files);

$deck->order_deck('Term');

$deck->shuffle_deck();

$card0 = $deck->card(0);

$term1 = $deck->card_side(1, 'Term');

DESCRIPTION

App::Tarotplane::Cards is a module used by tarotplane to read and organize decks of card files from text files. For information on how to format card files, consult the relevant documentation in the tarotplane manual page.

Object Methods

App::Tarotplane::Cards->new(@files)

Reads cards from @files, and returns an App::Tarotplane::Cards object. To read more about the card file format, consult the tarotplane manual page.

$deck->get($get)

Get $get from $deck. The following can be gotten:

Cards

Array ref of cards.

CardNum

Number of cards.

Returns undef on failure.

$deck->card($n)

Return $n-th card from deck. The card will be a hash ref that looks like this

{
  Term       => 'term string',
  Definition => 'definition string',
}

Returns undef on failure.

$deck->card_side($n, $side)

Returns side $side of card $n. $side must be 'Term' or 'Definition' (case-sensitive).

$deck->order_deck([$side])

Order cards alphabetically by $side, which must be 'Term' or 'Definition' (case-sensitive). If $side is not specified, sorts by terms.

$deck->shuffle_deck()

Randomize order of cards.

AUTHOR

Written by Samuel Young <samyoung12788@gmail.com>.

COPYRIGHT

Copyright 2024, Samuel Young

This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

tarotplane