Documentation
¶
Index ¶
Constants ¶
View Source
const ( HP_TOTAL_SCORE = 5 HP_STATE_NAME = "H/P State" )
Variables ¶
This section is empty.
Functions ¶
func HumanStatePage ¶
func HumanStatePage(humanState *HumanState, onKeyDown func(*dom.DOMEvent)) *dom.Node
HumanStatePage renders the complete human state page
Types ¶
type HumanState ¶
type HumanState struct {
HpScores int // 5 bars for the single hp state
FocusedBarIndex int // Which bar is currently focused (0-4)
OnAdjustScore func(delta int) error // Callback for when score is adjusted
Enqueue func(action func(ctx context.Context) error) // Async task enqueue function
LoadStateOnce func() // Load state once on first access
}
HumanState represents the state of human metrics with one hp state having 5 bars
func (*HumanState) AdjustScore ¶
func (hs *HumanState) AdjustScore(delta int)
AdjustScore increases or decreases the focused bar's score
Click to show internal directories.
Click to hide internal directories.