Draft: poop
This commit is contained in:
39
stages/game.go
Normal file
39
stages/game.go
Normal file
@@ -0,0 +1,39 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user