Documentation ¶
Index ¶
- Constants
- func AsSubModel() compositor.Option[*Model]
- func WithCompany(company *data.Company) compositor.Option[*Model]
- func WithCompanyMaxPoints(max int) compositor.Option[*Model]
- func WithGroup(group *data.Group) compositor.Option[*Model]
- func WithGroupMaxPoints(max int) compositor.Option[*Model]
- type Indexes
- type Limits
- type Model
- func (model *Model) ApplicableProfiles() (applicableProfiles []data.Profile)
- func (model *Model) ApplicableTraits() (applicableTraits []data.Trait)
- func (model *Model) CurrentTraitChoice() *data.TraitChoice
- func (model *Model) CurrentTraitWithChoice() *data.Trait
- func (model *Model) FormattedGroupName() string
- func (model *Model) GroupEditingOverview() string
- func (model *Model) Init() tea.Cmd
- func (model *Model) InitializeGroup(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
- func (model *Model) RemovableTraits() (removableTraits []data.Trait)
- func (model *Model) Return() *data.Group
- 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) UpdateBaseProfile(updating bool) (cmd tea.Cmd)
- func (model *Model) UpdateCompanyWorkingPointTotal()
- func (model *Model) UpdateCurrentTraitWithChoiceName()
- func (model *Model) UpdateEditingChoice() (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) UpdateTrait() (cmd tea.Cmd)
- func (model *Model) UpdateTraitAdd() tea.Cmd
- func (model *Model) UpdateTraitChoice() (cmd tea.Cmd)
- func (model *Model) UpdateTraitRemove() tea.Cmd
- func (model *Model) View() (view string)
- type Option
- type Substate
- 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)
- type Temp
Constants ¶
View Source
const ( StateCreatingGroup compositor.State = iota + 300 StateEditingGroup StateInitializingGroup StateInitializedGroup )
Variables ¶
This section is empty.
Functions ¶
func AsSubModel ¶
func AsSubModel() compositor.Option[*Model]
func WithCompany ¶
func WithCompany(company *data.Company) compositor.Option[*Model]
func WithCompanyMaxPoints ¶
func WithCompanyMaxPoints(max int) compositor.Option[*Model]
func WithGroupMaxPoints ¶
func WithGroupMaxPoints(max int) compositor.Option[*Model]
Types ¶
type Model ¶
type Model struct { *data.Group BaseProfile data.Group Company *data.Company Indexes Indexes Limits Limits Substate Substate Temp Temp TraitsWithChoices []*data.Trait // Could be any prompt, depends on the current choice TraitChooser *dynamic.Model }
func (*Model) ApplicableProfiles ¶
func (*Model) ApplicableTraits ¶
func (*Model) CurrentTraitChoice ¶
func (model *Model) CurrentTraitChoice() *data.TraitChoice
func (*Model) CurrentTraitWithChoice ¶
func (*Model) FormattedGroupName ¶
func (*Model) GroupEditingOverview ¶
func (*Model) InitializeGroup ¶
func (model *Model) InitializeGroup(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
func (*Model) RemovableTraits ¶
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) UpdateBaseProfile ¶
func (*Model) UpdateCompanyWorkingPointTotal ¶
func (model *Model) UpdateCompanyWorkingPointTotal()
func (*Model) UpdateCurrentTraitWithChoiceName ¶
func (model *Model) UpdateCurrentTraitWithChoiceName()
func (*Model) UpdateEditingChoice ¶
func (*Model) UpdateName ¶
func (model *Model) UpdateName(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
func (*Model) UpdateOnSubmodelEnded ¶
func (*Model) UpdateTrait ¶
func (*Model) UpdateTraitAdd ¶
func (*Model) UpdateTraitChoice ¶
func (*Model) UpdateTraitRemove ¶
type Substate ¶
type Substate struct { Creation SubstateCreating Editing SubstateEditing }
type SubstateCreating ¶
type SubstateCreating int
const ( IdleCreating SubstateCreating = iota Naming SelectingProfile )
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 SelectingOption Renaming ChangingBaseProfile ConfirmingBaseProfileUpdate AddingSpecialTrait RemovingSpecialTrait MakingTraitChoice )
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.