Documentation
¶
Index ¶
- type CardList
- func (cl *CardList) Head() (*card.Card, error)
- func (cl *CardList) Len() int
- func (cl *CardList) PopCard() (*card.Card, error)
- func (cl *CardList) PopCardIndex(index int) (*card.Card, error)
- func (cl *CardList) PushCard(c *card.Card)
- func (cl *CardList) Shuffle()
- func (cl *CardList) Slice() []*card.Card
- func (cl *CardList) String() string
- type CardListNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CardList ¶
type CardList struct {
// contains filtered or unexported fields
}
CardList is an attempt to represent a queue of cards using a linked list.
func NewCardListFromSlice ¶
NewCardListFromSlice accepts a slice of cards and constructs a list which is returned.
func NewStandardCardList ¶
func NewStandardCardList() *CardList
NewStandardCardList constructs a 52 card deck.
func (*CardList) Head ¶
Head returns the head card from the list without popping it, otherwise returns error.
func (*CardList) PopCard ¶
PopCard pops the head card from the list if it exists, otherwise returns error.
func (*CardList) PopCardIndex ¶
PopCardIndex pops a card at a specified index, otherwise returns error.
type CardListNode ¶
type CardListNode struct {
// contains filtered or unexported fields
}
func NewCardListNode ¶
func NewCardListNode(c *card.Card) *CardListNode
NewCardListNode constructs a new CardListNode from a Card.
Click to show internal directories.
Click to hide internal directories.