ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MonochromeMode = false
)

Functions

func GetGenerationColor

func GetGenerationColor(generation int) lipgloss.Color

GetGenerationColor returns a color based on generation

func ToggleMonochromeMode

func ToggleMonochromeMode()

Types

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

MenuModel represents the main menu state

func NewMenuModel

func NewMenuModel() MenuModel

NewMenuModel creates a new MenuModel with default choices and dimensions

func (m MenuModel) Init() tea.Cmd
func (m *MenuModel) SetDimensions(width, height int)

SetDimensions allows setting the menu dimensions when returning from a game

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

Update handles user input and updates the menu state

func (m MenuModel) View() string

View renders the menu

type SimulationModel

type SimulationModel struct {
	FocusMode bool
	// contains filtered or unexported fields
}

SimulationModel represents the state of the cellular automaton simulation

func NewSimulationModel

func NewSimulationModel(automatonType string) SimulationModel

NewSimulationModel creates a new SimulationModel for the specified automaton type

func (SimulationModel) Init

func (m SimulationModel) Init() tea.Cmd

Init initializes the simulation model, setting up the grid and starting the tick

func (SimulationModel) Update

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

Update handles user input and updates the simulation state

func (SimulationModel) View

func (m SimulationModel) View() string

View renders the current state of the simulation

Jump to

Keyboard shortcuts

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