0.1.0 • Published 4 years ago
@brightsole/bg-card-pile v0.1.0
bg-card-pile
What is it?
It's just a big pile of card
s, that might be anything.
It has a bunch of helpful ways to access these cards, and interact with the deck in a variety of human ways.
How to use it?
Method | Description | return |
---|---|---|
shuffle() | shuffle card order internally | void |
cardsRemainingCount() | Get the count of the cards left in the deck | number |
draw(number) | Draws x number of cards from the top of the pile | card |
drawFromBottom(number) | Draws x number of cards from the bottom of the pile | card |
drawRandomly(number) | Draws x number of cards randomly from the pile | card |
returnAndShuffle(card) | Returns cards to the deck and shuffles the order * | void |
returnToTop(card) | Returns cards onto the top of the deck in order * | void |
returnToBottom(card) | Returns cards onto the bottom of the deck in order * | void |
- All
return
methods try toreset
the card if the card is an object with a reset method
TODO:
nothing! It's a functional deck/graveyard/whatever pile of cards. Methods can be added as needed, but this will handle the next 3 games I have planned.