editor

package
v0.0.0-...-8b058bf Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateEditingMenu compositor.State = iota + 1000
	StatePlayerMenu
	StateCompanyMenu
	StateRosterMenu
)

Variables

This section is empty.

Functions

func WithCompany

func WithCompany(activeCompany *data.Company) compositor.Option[*Model]

func WithPlayer

func WithPlayer(activePlayer *persona.Player) compositor.Option[*Model]

Types

type Indexes

type Indexes struct {
	EditingCompany  int
	RemovingCompany int
}

type Model

type Model struct {
	tui.SharedModel
	Player   *player.Model
	Company  *company.Model
	Indexes  Indexes
	Substate Substate
}

func NewModel

func NewModel(api *flfa.Api, options ...compositor.Option[*Model]) *Model

func (*Model) AddCompany

func (model *Model) AddCompany() (cmd tea.Cmd)

func (*Model) Init

func (model *Model) Init() tea.Cmd

func (*Model) SetAndStartState

func (model *Model) SetAndStartState(state compositor.State) (cmd tea.Cmd)

func (*Model) SetAndStartSubstate

func (model *Model) SetAndStartSubstate(substate compositor.SubstateInterface[*Model]) (cmd tea.Cmd)

func (*Model) Update

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

func (*Model) UpdateCompany

func (model *Model) UpdateCompany() (cmd tea.Cmd)

func (*Model) UpdateConfirmQuitWithoutSaving

func (model *Model) UpdateConfirmQuitWithoutSaving() (cmd tea.Cmd)

func (*Model) UpdateConfirmRemoval

func (model *Model) UpdateConfirmRemoval() (cmd tea.Cmd)

func (*Model) UpdateConfirmSave

func (model *Model) UpdateConfirmSave(nextState compositor.State) (cmd tea.Cmd)

func (*Model) UpdateFallThrough

func (model *Model) UpdateFallThrough(msg tea.Msg) (cmd tea.Cmd)

func (*Model) UpdateOnKeyPress

func (model *Model) UpdateOnKeyPress(msg tea.KeyMsg) (cmd tea.Cmd)

func (*Model) UpdateOnSubmodelEnded

func (model *Model) UpdateOnSubmodelEnded() (cmd tea.Cmd)

func (*Model) UpdateSelectMenuOption

func (model *Model) UpdateSelectMenuOption() (cmd tea.Cmd)

func (*Model) UpdateSelectPlayerCompany

func (model *Model) UpdateSelectPlayerCompany() (cmd tea.Cmd)

func (*Model) View

func (model *Model) View() (view string)

type Substate

type Substate struct {
	Editing SubstateEditing
	Player  SubstatePlayer
	Company SubstateCompany
}

type SubstateCompany

type SubstateCompany int
const (
	CreatingCompany SubstateCompany = iota
	EditingCompany
)

func (SubstateCompany) Start

func (state SubstateCompany) Start(model *Model) (cmd tea.Cmd)

func (SubstateCompany) UpdateOnEnded

func (state SubstateCompany) UpdateOnEnded(model *Model) (cmd tea.Cmd)

func (SubstateCompany) UpdateOnEnter

func (state SubstateCompany) UpdateOnEnter(model *Model) (cmd tea.Cmd)

func (SubstateCompany) UpdateOnEsc

func (state SubstateCompany) UpdateOnEsc(model *Model) (cmd tea.Cmd)

func (SubstateCompany) UpdateOnFallThrough

func (state SubstateCompany) UpdateOnFallThrough(model *Model, msg tea.Msg) (cmd tea.Cmd)

func (SubstateCompany) View

func (state SubstateCompany) View(model *Model) (view string)

type SubstateEditing

type SubstateEditing int
const (
	SelectingOption SubstateEditing = iota
	SelectingCompanyToEdit
	SelectingCompanyToRemove
	ConfirmRemoval
	ConfirmSave
	ConfirmQuitWithoutSaving
)

func (SubstateEditing) Start

func (state SubstateEditing) Start(model *Model) (cmd tea.Cmd)

func (SubstateEditing) UpdateOnEnded

func (state SubstateEditing) UpdateOnEnded(model *Model) (cmd tea.Cmd)

func (SubstateEditing) UpdateOnEnter

func (state SubstateEditing) UpdateOnEnter(model *Model) (cmd tea.Cmd)

func (SubstateEditing) UpdateOnEsc

func (state SubstateEditing) UpdateOnEsc(model *Model) (cmd tea.Cmd)

func (SubstateEditing) UpdateOnFallThrough

func (state SubstateEditing) UpdateOnFallThrough(model *Model, msg tea.Msg) (cmd tea.Cmd)

func (SubstateEditing) View

func (state SubstateEditing) View(model *Model) (view string)

type SubstatePlayer

type SubstatePlayer int
const (
	SelectingPlayer SubstatePlayer = iota
)

func (SubstatePlayer) Start

func (state SubstatePlayer) Start(model *Model) (cmd tea.Cmd)

func (SubstatePlayer) UpdateOnEnded

func (state SubstatePlayer) UpdateOnEnded(model *Model) (cmd tea.Cmd)

func (SubstatePlayer) UpdateOnEnter

func (state SubstatePlayer) UpdateOnEnter(model *Model) (cmd tea.Cmd)

func (SubstatePlayer) UpdateOnEsc

func (state SubstatePlayer) UpdateOnEsc(model *Model) (cmd tea.Cmd)

func (SubstatePlayer) UpdateOnFallThrough

func (state SubstatePlayer) UpdateOnFallThrough(model *Model, msg tea.Msg) (cmd tea.Cmd)

func (SubstatePlayer) View

func (state SubstatePlayer) View(model *Model) (view string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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