Documentation ¶
Index ¶
- Constants
- func AsSubModel() compositor.Option[*Model]
- func WithPlayer(persona *player.Player) compositor.Option[*Model]
- type Model
- func (model *Model) Init() tea.Cmd
- func (model *Model) InitializePlayer(name string, nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
- func (model *Model) LoadPlayer() tea.Cmd
- func (model *Model) SavePlayer(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
- func (model *Model) SetAndStartState(state compositor.State) (cmd tea.Cmd)
- func (model *Model) SetAndStartSubstate(substate compositor.SubstateInterface[*Model]) (cmd tea.Cmd)
- func (model *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (model *Model) UpdateConfirmPreferred() (cmd tea.Cmd)
- func (model *Model) UpdateFallThrough(msg tea.Msg) (cmd tea.Cmd)
- func (model *Model) UpdateName(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
- func (model *Model) UpdateOnKeyPress(msg tea.KeyMsg) (cmd tea.Cmd)
- func (model *Model) UpdateOnSubmodelEnded() (cmd tea.Cmd)
- func (model *Model) UpdateSelectingPersona() (cmd tea.Cmd)
- func (model *Model) View() string
- type Substate
- type SubstateChoosing
- func (state SubstateChoosing) Start(model *Model) (cmd tea.Cmd)
- func (state SubstateChoosing) UpdateOnEnded(model *Model) (cmd tea.Cmd)
- func (state SubstateChoosing) UpdateOnEnter(model *Model) (cmd tea.Cmd)
- func (state SubstateChoosing) UpdateOnEsc(model *Model) (cmd tea.Cmd)
- func (state SubstateChoosing) UpdateOnFallThrough(model *Model, msg tea.Msg) (cmd tea.Cmd)
- func (state SubstateChoosing) View(model *Model) (view string)
- type SubstateCreating
- func (state SubstateCreating) Start(model *Model) (cmd tea.Cmd)
- func (state SubstateCreating) UpdateOnEnded(model *Model) (cmd tea.Cmd)
- func (state SubstateCreating) UpdateOnEnter(model *Model) (cmd tea.Cmd)
- func (state SubstateCreating) UpdateOnEsc(model *Model) (cmd tea.Cmd)
- func (state SubstateCreating) UpdateOnFallThrough(model *Model, msg tea.Msg) (cmd tea.Cmd)
- func (state SubstateCreating) View(model *Model) (view string)
- type SubstateEditing
- func (state SubstateEditing) Start(model *Model) (cmd tea.Cmd)
- func (state SubstateEditing) UpdateOnEnded(model *Model) (cmd tea.Cmd)
- func (state SubstateEditing) UpdateOnEnter(model *Model) (cmd tea.Cmd)
- func (state SubstateEditing) UpdateOnEsc(model *Model) (cmd tea.Cmd)
- func (state SubstateEditing) UpdateOnFallThrough(model *Model, msg tea.Msg) (cmd tea.Cmd)
- func (state SubstateEditing) View(model *Model) (view string)
Constants ¶
View Source
const ( StateChoosingPersona compositor.State = iota + 100 StateCreatingPersona StateEditingPersona )
Variables ¶
This section is empty.
Functions ¶
func AsSubModel ¶
func AsSubModel() compositor.Option[*Model]
func WithPlayer ¶
func WithPlayer(persona *player.Player) compositor.Option[*Model]
Types ¶
type Model ¶
func (*Model) InitializePlayer ¶
func (model *Model) InitializePlayer(name string, nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
func (*Model) LoadPlayer ¶
func (*Model) SavePlayer ¶
func (model *Model) SavePlayer(nextSubstate compositor.SubstateInterface[*Model]) 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) UpdateConfirmPreferred ¶
func (*Model) UpdateName ¶
func (model *Model) UpdateName(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
func (*Model) UpdateOnSubmodelEnded ¶
func (*Model) UpdateSelectingPersona ¶
type Substate ¶
type Substate struct { Choosing SubstateChoosing Creating SubstateCreating Editing SubstateEditing }
type SubstateChoosing ¶
type SubstateChoosing int
const (
SelectingPersona SubstateChoosing = iota
)
func (SubstateChoosing) UpdateOnEnded ¶
func (state SubstateChoosing) UpdateOnEnded(model *Model) (cmd tea.Cmd)
func (SubstateChoosing) UpdateOnEnter ¶
func (state SubstateChoosing) UpdateOnEnter(model *Model) (cmd tea.Cmd)
func (SubstateChoosing) UpdateOnEsc ¶
func (state SubstateChoosing) UpdateOnEsc(model *Model) (cmd tea.Cmd)
func (SubstateChoosing) UpdateOnFallThrough ¶
func (SubstateChoosing) View ¶
func (state SubstateChoosing) View(model *Model) (view string)
type SubstateCreating ¶
type SubstateCreating int
const ( Naming SubstateCreating = iota DecidingIfPreferred )
func (SubstateCreating) UpdateOnEnded ¶
func (state SubstateCreating) UpdateOnEnded(model *Model) (cmd tea.Cmd)
func (SubstateCreating) UpdateOnEnter ¶
func (state SubstateCreating) UpdateOnEnter(model *Model) (cmd tea.Cmd)
func (SubstateCreating) UpdateOnEsc ¶
func (state SubstateCreating) UpdateOnEsc(model *Model) (cmd tea.Cmd)
func (SubstateCreating) UpdateOnFallThrough ¶
func (SubstateCreating) View ¶
func (state SubstateCreating) View(model *Model) (view string)
type SubstateEditing ¶
type SubstateEditing int
const ( IdleEditing SubstateEditing = iota SelectingEditingOption Renaming ConfirmingRename ConfirmingPreferredStatusUpdate )
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 (SubstateEditing) View ¶
func (state SubstateEditing) View(model *Model) (view string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.