Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultPetStats = []*Stat{ {Name: "Health", Value: 100}, {Name: "Boredom", Value: 0, Delta: 5}, {Name: "Thirst", Value: 0, Delta: 3}, {Name: "Hunger", Value: 0, Delta: 2}, {Name: "Fatigue", Value: 0, Delta: 2}, } StatNames []string StatUpdateInterval = time.Second * 5 CurrentPet *Pet )
Functions ¶
This section is empty.
Types ¶
type Pet ¶
type Pet struct { Name string IsDead bool StatLock *sync.RWMutex Stats []*Stat StatUpdateNotifier chan bool }
func (*Pet) FixStats ¶
func (p *Pet) FixStats()
FixStats ensures all stat values are within the range 0<=n<=100
func (*Pet) SetStatDelta ¶
SetStatDelta applies a delta to a statistic by name
Click to show internal directories.
Click to hide internal directories.