models

package
v0.0.0-...-80cf271 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyHarvest        = "H"     // Harvest node directly
	KeyHarvestTick    = "enter" // Harvest node directly
	KeyHarvestTickAlt = " "     // Alternative harvest (space)
)

Key binding constants

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is the main application model

func NewApp

func NewApp(database *sql.DB, queries *db.Queries, chunkManager *chunk.Manager, playerManager *player.Manager, startView string) *App

NewApp creates a new application instance

func (*App) Init

func (m *App) Init() tea.Cmd

Init initializes the application

func (*App) Update

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

Update handles messages and updates the application state

func (*App) View

func (m *App) View() string

View renders the application

type ChunkExplorerModel

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

ChunkExplorerModel handles the chunk visualization view

func NewChunkExplorerModel

func NewChunkExplorerModel(database *sql.DB, queries *db.Queries, chunkManager *chunk.Manager, playerManager *player.Manager) ChunkExplorerModel

NewChunkExplorerModel creates a new chunk explorer model

func (*ChunkExplorerModel) GetHarvestMsg

func (m *ChunkExplorerModel) GetHarvestMsg() string

GetHarvestMsg returns the current harvest message

func (*ChunkExplorerModel) HarvestNode

func (m *ChunkExplorerModel) HarvestNode(msg tea.Msg) tea.Cmd

HarvestNode directly harvests the node under the cursor using the new API

func (ChunkExplorerModel) Init

func (m ChunkExplorerModel) Init() tea.Cmd

Init initializes the chunk explorer

func (*ChunkExplorerModel) Reset

func (m *ChunkExplorerModel) Reset()

Reset cleans up the harvesting state when leaving the screen

func (*ChunkExplorerModel) SetSize

func (m *ChunkExplorerModel) SetSize(width, height int)

SetSize updates the chunk explorer size

func (ChunkExplorerModel) Update

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

Update handles chunk explorer messages

func (ChunkExplorerModel) View

func (m ChunkExplorerModel) View() string

View renders the chunk explorer

type DatabaseModel

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

DatabaseModel handles the database inspector view

func NewDatabaseModel

func NewDatabaseModel(database *sql.DB, queries *db.Queries) DatabaseModel

NewDatabaseModel creates a new database model

func (DatabaseModel) Init

func (m DatabaseModel) Init() tea.Cmd

Init initializes the database model

func (*DatabaseModel) SetSize

func (m *DatabaseModel) SetSize(width, height int)

SetSize updates the database model size

func (DatabaseModel) Update

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

Update handles database model messages

func (DatabaseModel) View

func (m DatabaseModel) View() string

View renders the database inspector

type MenuChoice struct {
	Title       string
	Description string
	Icon        string
	View        ViewType
}

MenuChoice represents a menu option

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

MenuModel handles the main menu view

func NewMenuModel

func NewMenuModel() MenuModel

NewMenuModel creates a new menu model

func (m MenuModel) Init() tea.Cmd

Init initializes the menu

func (m *MenuModel) SetSize(width, height int)

SetSize updates the menu size

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

Update handles menu messages

func (m MenuModel) View() string

View renders the menu

type NodeGeneratorModel

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

NodeGeneratorModel handles the node generator view

func NewNodeGeneratorModel

func NewNodeGeneratorModel(database *sql.DB, queries *db.Queries, chunkManager *chunk.Manager) NodeGeneratorModel

NewNodeGeneratorModel creates a new node generator model

func (NodeGeneratorModel) Init

func (m NodeGeneratorModel) Init() tea.Cmd

Init initializes the node generator

func (*NodeGeneratorModel) SetSize

func (m *NodeGeneratorModel) SetSize(width, height int)

SetSize updates the node generator size

func (NodeGeneratorModel) Update

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

Update handles node generator messages

func (NodeGeneratorModel) View

func (m NodeGeneratorModel) View() string

View renders the node generator

type OverviewModel

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

OverviewModel handles the system overview view

func NewOverviewModel

func NewOverviewModel(database *sql.DB, queries *db.Queries) OverviewModel

NewOverviewModel creates a new overview model

func (OverviewModel) Init

func (m OverviewModel) Init() tea.Cmd

Init initializes the overview

func (*OverviewModel) SetSize

func (m *OverviewModel) SetSize(width, height int)

SetSize updates the overview size

func (OverviewModel) Update

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

Update handles overview messages

func (OverviewModel) View

func (m OverviewModel) View() string

View renders the overview

type SessionMonitorModel

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

SessionMonitorModel handles the session monitoring view

func NewSessionMonitorModel

func NewSessionMonitorModel(database *sql.DB, queries *db.Queries) SessionMonitorModel

NewSessionMonitorModel creates a new session monitor model

func (SessionMonitorModel) Init

func (m SessionMonitorModel) Init() tea.Cmd

Init initializes the session monitor

func (*SessionMonitorModel) SetSize

func (m *SessionMonitorModel) SetSize(width, height int)

SetSize updates the session monitor size

func (SessionMonitorModel) Update

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

Update handles session monitor messages

func (SessionMonitorModel) View

func (m SessionMonitorModel) View() string

View renders the session monitor

type SwitchViewMsg

type SwitchViewMsg struct {
	View ViewType
}

SwitchViewMsg is a message to switch views

func NewSwitchViewMsg

func NewSwitchViewMsg(view ViewType) SwitchViewMsg

NewSwitchViewMsg creates a new switch view message

type ViewType

type ViewType int

ViewType represents the different views in the debug tool

const (
	MenuView ViewType = iota
	ChunkExplorerView
	SessionMonitorView
	DatabaseView
	NodeGeneratorView
	OverviewView
)

Jump to

Keyboard shortcuts

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