deck

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardsFunc

type CardsFunc func(string) ([]*card.Card, error)

type Deck

type Deck struct {
	// contains filtered or unexported fields
}

stack.review contains checksums. cardMap maps checksums to cards. predictMap maps checksums to cards.

func NewDeck

func NewDeck(now time.Time) *Deck

func (*Deck) AddCards

func (d *Deck) AddCards(cards ...*card.Card)

Add cards only if they don't exist.

func (*Deck) AddPredicts

func (d *Deck) AddPredicts(predicts ...*meta.Predict)

Add predictions only if they don't exist.

func (*Deck) CardList

func (d *Deck) CardList() []*card.Card

Used for printing the cards.

func (*Deck) Clone

func (d *Deck) Clone(o *Deck)

Clones a deck into this deck.

func (*Deck) Copy

func (d *Deck) Copy() *Deck

func (*Deck) DropTop

func (d *Deck) DropTop()

Removes from both the internal map and the slice.

func (*Deck) Edit

func (d *Deck) Edit(rf CardsFunc, ef CardsFunc) error

TODO: Concurrency locks for thread safety?

func (*Deck) ExecTop

func (d *Deck) ExecTop(input bool, now time.Time) (meta.Predict, error)

TODO: Concurrency locks for thread safety?

func (*Deck) FutureLen

func (d *Deck) FutureLen() int

func (*Deck) OutcomeList

func (d *Deck) OutcomeList() []*meta.Outcome

Used to write to the outcome file.

func (*Deck) PredictList

func (d *Deck) PredictList() []*meta.Predict

Used to write to the predict file.

func (*Deck) RemoveDone

func (d *Deck) RemoveDone()

func (*Deck) RemoveMemorize

func (d *Deck) RemoveMemorize()

func (*Deck) RemoveReview

func (d *Deck) RemoveReview()

func (*Deck) ReviewLen

func (d *Deck) ReviewLen() int

func (*Deck) TopCard

func (d *Deck) TopCard() *card.Card

func (*Deck) TopHash

func (d *Deck) TopHash() *internal.Hash

Top shortcuts

func (*Deck) TopPredict

func (d *Deck) TopPredict() *meta.Predict

func (*Deck) Truncate

func (d *Deck) Truncate(param int)

Only so many cards are allowed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL