Deck does enough stuff it should be its own thing; its internal representation might change to make multiple insertions not quadratic, among other reasons. Currently it just does the obvious stuff, though. Allows inserting cards in random or specific slots and drawing cards. Shuffling a range of the deck comes later.
17 lines
359 B
Go
17 lines
359 B
Go
package cardsim
|
|
|
|
import "math/rand"
|
|
|
|
// Player stores all gameplay state for one player.
|
|
type Player[C StatsCollection] struct {
|
|
Stats C
|
|
Name string
|
|
Deck *Deck[C]
|
|
Hand []Card[C]
|
|
HandLimit int
|
|
Rules *RuleCollection[C]
|
|
Rand rand.Rand
|
|
Turn int
|
|
PendingMessages []Message
|
|
}
|