ui

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DIRECTIONS = map[string]string{
	"LEFT":  "LEFT",
	"RIGHT": "RIGHT",
	"UP":    "UP",
	"DOWN":  "DOWN",
}
View Source
var INDEX_TO_TABLE_MAP = map[int]string{
	0: "awayBatters",
	1: "homeBatters",
	2: "awayPitchers",
	3: "homePitchers",
}
View Source
var TABLE_TO_INDEX_MAP = map[string]int{
	"awayBatters":  0,
	"homeBatters":  1,
	"awayPitchers": 2,
	"homePitchers": 3,
}

Functions

func InitModel

func InitModel(date time.Time) tea.Model

func StartTea

func StartTea(date time.Time)

Types

type GameScreenKM added in v0.0.3

type GameScreenKM struct {
	Up         key.Binding
	Down       key.Binding
	UpTable    key.Binding
	DownTable  key.Binding
	Back       key.Binding
	Quit       key.Binding
	Enter      key.Binding
	Left       key.Binding
	LeftTable  key.Binding
	Right      key.Binding
	RightTable key.Binding
}

func (GameScreenKM) FullHelp added in v0.0.3

func (k GameScreenKM) FullHelp() [][]key.Binding

func (*GameScreenKM) SetEnabled added in v0.0.4

func (k *GameScreenKM) SetEnabled(enabled bool)

func (GameScreenKM) ShortHelp added in v0.0.3

func (k GameScreenKM) ShortHelp() []key.Binding

type GameScreenModel

type GameScreenModel struct {
	// contains filtered or unexported fields
}

func InitGameScreenModel

func InitGameScreenModel(game mlb.Game, previousModel Model) *GameScreenModel

func (GameScreenModel) Init

func (m GameScreenModel) Init() tea.Cmd

func (GameScreenModel) Update

func (m GameScreenModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (GameScreenModel) View

func (m GameScreenModel) View() string

type GamesListKM added in v0.0.3

type GamesListKM struct {
	Up          key.Binding
	Down        key.Binding
	Previous    key.Binding
	Next        key.Binding
	Quit        key.Binding
	Enter       key.Binding
	FocusPicker key.Binding
}

func (GamesListKM) FullHelp added in v0.0.3

func (k GamesListKM) FullHelp() [][]key.Binding

func (GamesListKM) ShortHelp added in v0.0.3

func (k GamesListKM) ShortHelp() []key.Binding

type Model

type Model struct {
	// contains filtered or unexported fields
}

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) UpdateWithDate

func (m Model) UpdateWithDate(date time.Time) Model

func (Model) View

func (m Model) View() string

Directories

Path Synopsis
Credit to @dylantientcheu for this implementation originally from nbacli https://github.com/dylantientcheu/nbacli/blob/master/ui/gameboard/scoretext/scoretext.go
Credit to @dylantientcheu for this implementation originally from nbacli https://github.com/dylantientcheu/nbacli/blob/master/ui/gameboard/scoretext/scoretext.go
Credit to @TypicalAM https://github.com/TypicalAM/goread
Credit to @TypicalAM https://github.com/TypicalAM/goread

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL