More display components.

This commit is contained in:
Kistaro Windrider 2023-04-02 00:43:17 -07:00
parent e1eac9de0f
commit 592c877852
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -71,6 +71,9 @@ func pickNextAction[C StatsCollection](p *Player[C]) (isCard bool, cardIdx int,
divider() divider()
} }
handOffset := displayPermanentActionsMenu(p, actionsOffset) handOffset := displayPermanentActionsMenu(p, actionsOffset)
if handOffset > actionsOffset {
fmt.Println()
}
max := displayHandMenu(p, handOffset) max := displayHandMenu(p, handOffset)
divider() divider()
@ -180,7 +183,31 @@ func displayStatsMenu[C StatsCollection](p *Player[C]) int {
fmt.Println("Info Panels") fmt.Println("Info Panels")
fmt.Println("-----------") fmt.Println("-----------")
for i, s := range p.InfoPanels { for i, s := range p.InfoPanels {
fmt.Printf("[%2d]: %s", i+1, s.Title(p).String()) fmt.Printf("[%2d]: %s\n", i+1, s.Title(p).String())
} }
return len(p.InfoPanels) return len(p.InfoPanels)
} }
func displayPermanentActionsMenu[C StatsCollection](p *Player[C], offset int) int {
if len(p.PermanentActions) == 0 {
return offset
}
fmt.Println("Always Available")
fmt.Println("----------------")
for i, s := range p.PermanentActions {
fmt.Printf("[%2d]: %s\n", i+offset+1, s.Title(p))
}
return offset + len(p.PermanentActions)
}
func displayHandMenu[C StatsCollection](p *Player[C], offset int) int {
if len(p.Hand) == 0 {
return offset
}
fmt.Println("Hand")
fmt.Println("----")
for i, s := range p.Hand {
fmt.Printf("[%2d]: %s\n", i+offset+1, s.Title(p))
}
return offset + len(p.Hand)
}