#Generic #Card #Deck

card_deck

A Generic Deck of Cards, with a draw and discard pile

8 releases

new 0.1.7 Aug 9, 2018
0.1.6 Aug 8, 2018
0.1.4 Jul 27, 2018

#12 in #generic

Download history 65/week @ 2018-07-27 16/week @ 2018-08-03 78/week @ 2018-08-10

52 downloads per month

Card Deck

The intent of this module is to provide methods for managing a deck and discard pile from a deck of generic cards.

The expectation is that cards will moved into and out of the deck, copy and clone are not used internally.

Coming soon:

FromStr and Display methods for playing cards module

Changes

in v0.1.7

A playing cards module that works well with this deck.

in v0.1.5

Added "dig_for" and "dig_all" methods for grabbing the first/all cards that match a filter respectively.


lib.rs:

Card Deck acts as a draw and discard pile to on any kind of card.

Contributions Welcome

It is defined Generically so as not to be limited to anything specific like standard playing cards.

It takes the attitude that cards, in generall, cannot be copied. As such cards are not borrowed. Instead they are consumed to be added, and when they are drawn, full ownership is returned.

For some (digital) card games, cards can be copied. If you wish to implement Clone, that will work in those cases.

MIT license

Dependencies

Reverse deps