Compare commits
No commits in common. "fb5735d5b94d5ea9e014e360a5f33991daaadc34" and "f8b6b6b376f87fdd0059182d09aa6c48b5510912" have entirely different histories.
fb5735d5b9
...
f8b6b6b376
@ -9,10 +9,6 @@ type Card[C StatsCollection] interface {
|
|||||||
// a warning, the game crashes.
|
// a warning, the game crashes.
|
||||||
Title(p *Player[C]) (Message, error)
|
Title(p *Player[C]) (Message, error)
|
||||||
|
|
||||||
// Urgent reports whether the card is considered urgent. If
|
|
||||||
// the player hasa any
|
|
||||||
Urgent(p *Player[C]) bool
|
|
||||||
|
|
||||||
// EventText returns the text to display on the card. If it returns an
|
// EventText returns the text to display on the card. If it returns an
|
||||||
// error that is not a warning, the game crashes.
|
// error that is not a warning, the game crashes.
|
||||||
EventText(p *Player[C]) (Message, error)
|
EventText(p *Player[C]) (Message, error)
|
||||||
@ -47,7 +43,6 @@ type CardOption[C StatsCollection] interface {
|
|||||||
// A BasicCard is a Card with fixed title, text, options, and optional post-option callback.
|
// A BasicCard is a Card with fixed title, text, options, and optional post-option callback.
|
||||||
type BasicCard[C StatsCollection] struct {
|
type BasicCard[C StatsCollection] struct {
|
||||||
CardTitle Message
|
CardTitle Message
|
||||||
IsUrgent bool
|
|
||||||
CardText Message
|
CardText Message
|
||||||
CardOptions []CardOption[C]
|
CardOptions []CardOption[C]
|
||||||
AfterOption func(p *Player[C], option CardOption[C]) error
|
AfterOption func(p *Player[C], option CardOption[C]) error
|
||||||
@ -57,10 +52,6 @@ func (b *BasicCard[C]) Title(p *Player[C]) (Message, error) {
|
|||||||
return b.CardTitle, nil
|
return b.CardTitle, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BasicCard[C]) Urgent(_ *Player[C]) bool {
|
|
||||||
return b.IsUrgent
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BasicCard[C]) EventText(p *Player[C]) (Message, error) {
|
func (b *BasicCard[C]) EventText(p *Player[C]) (Message, error) {
|
||||||
return b.CardText, nil
|
return b.CardText, nil
|
||||||
}
|
}
|
||||||
|
@ -4,16 +4,13 @@ import "math/rand"
|
|||||||
|
|
||||||
// Player stores all gameplay state for one player.
|
// Player stores all gameplay state for one player.
|
||||||
type Player[C StatsCollection] struct {
|
type Player[C StatsCollection] struct {
|
||||||
Stats C
|
Stats C
|
||||||
Name string
|
Name string
|
||||||
Deck *Deck[C]
|
Deck *Deck[C]
|
||||||
Hand []Card[C]
|
Hand []Card[C]
|
||||||
HandLimit int
|
HandLimit int
|
||||||
ActionsPerTurn int
|
Rules *RuleCollection[C]
|
||||||
ActionsRemaining int
|
Rand rand.Rand
|
||||||
PermanentActions []Card[C]
|
Turn int
|
||||||
Rules *RuleCollection[C]
|
PendingMessages []Message
|
||||||
Rand rand.Rand
|
|
||||||
Turn int
|
|
||||||
PendingMessages []Message
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user