Files
inp2025/stages/game.go
2025-11-10 14:23:08 +08:00

40 lines
586 B
Go

package stages
import (
"inp2025/models"
"strings"
tea "github.com/charmbracelet/bubbletea"
)
type GameModel struct {
state models.GameState
}
func NewGameModel() *GameModel {
return &GameModel{}
}
func (m *GameModel) Init() tea.Cmd {
return tea.ClearScreen
}
func (m *GameModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmds []tea.Cmd
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "ctrl+c":
return m, tea.Quit
}
}
return m, tea.Batch(cmds...)
}
func (m *GameModel) View() string {
var b strings.Builder
return b.String()
}