state

package
v0.0.0-...-c01338d Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CURSOR_COLUMN = 0
	CURSOR_ROW    = 1

	TAB_GAME        = 0
	TAB_SETTINGS    = 1
	TAB_LEADERBOARD = 2
	TAB_ABOUT       = 3

	GAME_COLUMN_ITEMS    = 0
	GAME_COLUMN_UPGRADES = 1
)

Variables

View Source
var SessionCount = 0
View Source
var TopUsersList []model.User

Functions

func GetTopUsers

func GetTopUsers(db *sql.DB)

func SessionCountMiddleware

func SessionCountMiddleware() wish.Middleware

func TopUsers

func TopUsers() []string

Types

type State

type State struct {
	Term      string
	Width     int
	Height    int
	PerSecond uint64

	Cursor       [2]int
	SelectedTab  int
	SelectedItem int

	User model.User

	Db *sql.DB

	ChangelogViewport viewport.Model
	// contains filtered or unexported fields
}

func (State) CostList

func (m State) CostList() string

func (State) CursorColumn

func (m State) CursorColumn() int

func (State) CursorRow

func (m State) CursorRow() int

func (State) GameTick

func (m State) GameTick() State

func (State) IncrementTab

func (m State) IncrementTab(up bool) State

func (State) Init

func (m State) Init() tea.Cmd

func (State) RecalculateCursorDisplay

func (m State) RecalculateCursorDisplay() State

func (State) SetCursor

func (m State) SetCursor(col, row int) State

func (State) SetCursorColumn

func (m State) SetCursorColumn(col int) State

func (State) SetCursorRow

func (m State) SetCursorRow(row int) State

func (State) SetupData

func (m State) SetupData() State

func (State) Update

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

func (State) UpgradeList

func (m State) UpgradeList() string

func (State) View

func (m State) View() string

func (State) ViewerCount

func (m State) ViewerCount() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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