Documentation
¶
Index ¶
- func PositiveIntegerValidator(max int) func(text string, ch rune) bool
- type ActionDisplay
- type ActionList
- type CompanyList
- type CompanyProvider
- type ConfirmPanel
- type ErrorModal
- type GraphPanel
- type HistoryPanel
- type LobbyForm
- type LoginData
- type LoginForm
- type PlayerProvider
- type ServerStatusPanel
- type StandingsPanel
- type TitlePanel
- type TradeForm
- type TradeMenu
- type TradeOption
- type TurnPanel
- type VersionPanel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionDisplay ¶ added in v0.0.3
type ActionDisplay struct {
// contains filtered or unexported fields
}
func NewActionDisplay ¶ added in v0.0.3
func NewActionDisplay(cp *CompanyProvider) *ActionDisplay
func (*ActionDisplay) GetTextView ¶ added in v0.0.3
func (a *ActionDisplay) GetTextView() *tview.TextView
func (*ActionDisplay) Update ¶ added in v0.0.3
func (a *ActionDisplay) Update(cards []*game.Card)
type ActionList ¶
type ActionList struct {
// contains filtered or unexported fields
}
func NewActionList ¶
func NewActionList(cp *CompanyProvider, cards []*game.Card, cb func(*game.Card)) *ActionList
func (*ActionList) GetList ¶
func (a *ActionList) GetList() *tview.List
type CompanyList ¶
type CompanyList struct {
// contains filtered or unexported fields
}
func NewCompanyList ¶
func NewCompanyList(cp *CompanyProvider, cb func(int)) *CompanyList
func (*CompanyList) GetList ¶
func (c *CompanyList) GetList() *tview.List
type CompanyProvider ¶
type CompanyProvider struct {
// contains filtered or unexported fields
}
func NewCompanyProvider ¶
func NewCompanyProvider() *CompanyProvider
func (*CompanyProvider) ColorByIndex ¶
func (p *CompanyProvider) ColorByIndex(index int) string
func (*CompanyProvider) Companies ¶
func (p *CompanyProvider) Companies() []string
func (*CompanyProvider) CompanyByIndex ¶
func (p *CompanyProvider) CompanyByIndex(index int) string
func (*CompanyProvider) SetCompanies ¶
func (p *CompanyProvider) SetCompanies(companies []string)
type ConfirmPanel ¶
type ConfirmPanel struct {
// contains filtered or unexported fields
}
func NewConfirmPanel ¶
func NewConfirmPanel(result chan bool) *ConfirmPanel
func (*ConfirmPanel) GetForm ¶
func (c *ConfirmPanel) GetForm() *tview.Form
type ErrorModal ¶
type ErrorModal struct {
// contains filtered or unexported fields
}
ErrorModal is a modal that displays an error message.
func NewErrorModal ¶
func NewErrorModal(err error) *ErrorModal
NewErrorModal creates a new ErrorModal.
func (*ErrorModal) GetModal ¶
func (e *ErrorModal) GetModal() *tview.Modal
GetModal returns the underlying tview.Modal.
func (*ErrorModal) SetHandler ¶
func (e *ErrorModal) SetHandler(handler func(buttonIndex int, buttonLabel string)) *ErrorModal
SetHandler sets the done func for the modal.
type GraphPanel ¶
type GraphPanel struct {
// contains filtered or unexported fields
}
func NewGraphPanel ¶
func NewGraphPanel(cp *CompanyProvider) *GraphPanel
func (*GraphPanel) Add ¶
func (p *GraphPanel) Add(prices [4]int)
func (*GraphPanel) GetGrid ¶
func (p *GraphPanel) GetGrid() *tview.Grid
type HistoryPanel ¶
type HistoryPanel struct {
// contains filtered or unexported fields
}
func NewHistoryPanel ¶
func NewHistoryPanel(cp *CompanyProvider) *HistoryPanel
func (*HistoryPanel) AddAction ¶
func (p *HistoryPanel) AddAction(a *message.Action)
func (*HistoryPanel) AddTrade ¶
func (p *HistoryPanel) AddTrade(d *message.Trade)
func (*HistoryPanel) GetTextView ¶
func (p *HistoryPanel) GetTextView() *tview.TextView
type LobbyForm ¶
type LobbyForm struct {
// contains filtered or unexported fields
}
func NewLobbyForm ¶
type LoginForm ¶
type LoginForm struct {
// contains filtered or unexported fields
}
LoginForm wraps a tview.Form and adds some validation logic.
func NewLoginForm ¶
NewLoginForm creates a new LoginForm.
func (*LoginForm) SetReconnectKey ¶
type PlayerProvider ¶
type PlayerProvider struct {
// contains filtered or unexported fields
}
func NewPlayerProvider ¶
func NewPlayerProvider(players []string) *PlayerProvider
func (*PlayerProvider) OpponentsByPlayer ¶
func (p *PlayerProvider) OpponentsByPlayer(player string) []string
func (*PlayerProvider) Players ¶
func (p *PlayerProvider) Players() []string
type ServerStatusPanel ¶
type ServerStatusPanel struct {
// contains filtered or unexported fields
}
func NewServerStatus ¶
func NewServerStatus() *ServerStatusPanel
func (*ServerStatusPanel) GetTextView ¶
func (p *ServerStatusPanel) GetTextView() *tview.TextView
func (*ServerStatusPanel) SetConnection ¶
func (p *ServerStatusPanel) SetConnection(isConnected bool)
func (*ServerStatusPanel) SetHost ¶
func (p *ServerStatusPanel) SetHost(host string)
func (*ServerStatusPanel) SetReconnectKey ¶
func (p *ServerStatusPanel) SetReconnectKey(key string)
type StandingsPanel ¶
type StandingsPanel struct {
// contains filtered or unexported fields
}
func NewStandingsPanel ¶
func NewStandingsPanel(cp *CompanyProvider) *StandingsPanel
func (*StandingsPanel) GetGrid ¶
func (p *StandingsPanel) GetGrid() *tview.Grid
func (*StandingsPanel) Update ¶
func (p *StandingsPanel) Update(state *message.GameState)
type TitlePanel ¶
type TitlePanel struct {
// contains filtered or unexported fields
}
func NewTitlePanel ¶
func NewTitlePanel() *TitlePanel
func (*TitlePanel) GetTextView ¶
func (p *TitlePanel) GetTextView() *tview.TextView
type TradeForm ¶
type TradeForm struct {
// contains filtered or unexported fields
}
func NewTradeForm ¶
type TradeMenu ¶
type TradeMenu struct {
// contains filtered or unexported fields
}
func NewTradeMenu ¶
func NewTradeMenu(cb func(option TradeOption)) *TradeMenu
type TurnPanel ¶
type TurnPanel struct {
// contains filtered or unexported fields
}
func NewTurnPanel ¶
func NewTurnPanel() *TurnPanel
func (*TurnPanel) GetTextView ¶
type VersionPanel ¶
type VersionPanel struct {
// contains filtered or unexported fields
}
func NewVersionPanel ¶
func NewVersionPanel() *VersionPanel
func (*VersionPanel) GetTextView ¶
func (p *VersionPanel) GetTextView() *tview.TextView
func (*VersionPanel) SetVersion ¶
func (p *VersionPanel) SetVersion(v string)
Source Files
¶
- action_display.go
- action_list.go
- company_list.go
- company_provider.go
- confirm_panel.go
- error_modal.go
- graph_panel.go
- history_panel.go
- input_validators.go
- lobby_form.go
- login_form.go
- player_provider.go
- server_status_panel.go
- standings_panel.go
- title_panel.go
- trade_form.go
- trade_menu.go
- turn_panel.go
- utils.go
- version_panel.go
Click to show internal directories.
Click to hide internal directories.