Documentation ¶
Index ¶
- Constants
- func AsSubModel() compositor.Option[*Model]
- func WithAvailableCompanies(companies []data.Company) compositor.Option[*Model]
- func WithCompany(company *data.Company) compositor.Option[*Model]
- func WithCompanyMaxPoints(max int) compositor.Option[*Model]
- func WithGroupMaxPoints(max int) compositor.Option[*Model]
- type Indexes
- type Limits
- type Model
- func (model *Model) AddGroup() tea.Cmd
- func (model *Model) CaptainSummary() string
- func (model *Model) CaptainsGroup() (captain data.Group)
- func (model *Model) CompanyOverview() string
- func (model *Model) FormattedCompanyDescription() string
- func (model *Model) FormattedCompanyName() string
- func (model *Model) HasCaptain() bool
- func (model *Model) Init() 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) ShouldDisplayCaptainSummary() bool
- func (model *Model) ShouldDisplayCompanyOverview() bool
- func (model *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (model *Model) UpdateCaptainDemotion() tea.Cmd
- func (model *Model) UpdateCaptainReplacement() tea.Cmd
- func (model *Model) UpdateCaptainSelection() (cmd tea.Cmd)
- func (model *Model) UpdateCaptainTrait() tea.Cmd
- func (model *Model) UpdateDescription(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
- func (model *Model) UpdateEditingChoice() (cmd tea.Cmd)
- func (model *Model) UpdateFallThrough(msg tea.Msg) (cmd tea.Cmd)
- func (model *Model) UpdateGroup() tea.Cmd
- func (model *Model) UpdateGroupSelection() (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) UpdateRerolledCaptainTrait() tea.Cmd
- func (model *Model) UpdateSelectingCompany() tea.Cmd
- func (model *Model) View() (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) 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) string
Constants ¶
View Source
const ( StateChoosingCompany compositor.State = iota + 200 StateCreatingCompany StateEditingCompany StateLoadingCompany StateLoadedCompany StateSavingCompany StateSavedCompany )
Variables ¶
This section is empty.
Functions ¶
func AsSubModel ¶
func AsSubModel() compositor.Option[*Model]
func WithAvailableCompanies ¶
func WithAvailableCompanies(companies []data.Company) 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.Company Limits Limits Indexes Indexes AvailableCompanies []data.Company Substate Substate Group *group.Model }
func (*Model) CaptainSummary ¶
func (*Model) CaptainsGroup ¶
func (*Model) CompanyOverview ¶
func (*Model) FormattedCompanyDescription ¶
func (*Model) FormattedCompanyName ¶
func (*Model) HasCaptain ¶
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) ShouldDisplayCaptainSummary ¶
func (*Model) ShouldDisplayCompanyOverview ¶
func (*Model) UpdateCaptainDemotion ¶
func (*Model) UpdateCaptainReplacement ¶
func (*Model) UpdateCaptainSelection ¶
func (*Model) UpdateCaptainTrait ¶
func (*Model) UpdateDescription ¶
func (model *Model) UpdateDescription(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
func (*Model) UpdateEditingChoice ¶
func (*Model) UpdateGroup ¶
func (*Model) UpdateGroupSelection ¶
func (*Model) UpdateName ¶
func (model *Model) UpdateName(nextSubstate compositor.SubstateInterface[*Model]) tea.Cmd
func (*Model) UpdateOnSubmodelEnded ¶
func (*Model) UpdateRerolledCaptainTrait ¶
func (*Model) UpdateSelectingCompany ¶
type Substate ¶
type Substate struct { Choosing SubstateChoosing Creating SubstateCreating Editing SubstateEditing }
type SubstateChoosing ¶
type SubstateChoosing int
const (
SelectingCompany 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 Describing AddingFirstGroup )
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) string
type SubstateEditing ¶
type SubstateEditing int
const ( SelectingOption SubstateEditing = iota Renaming Redescribing AddingGroup SelectingGroupToEdit SelectingGroupToPromote EditingGroup CopyingGroup RemovingGroup SelectingCaptainOption RerollingCaptainTrait SelectingCaptainTrait SelectingCaptainReplacement ConfirmingCaptainReplacement ConfirmingCaptainDemotion )
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) string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.