engine

package
v0.0.0-...-60c38a5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package engine provides a simple P&P engine

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	App       *tview.Application
	Pages     *tview.Pages
	Menu      *tview.List
	Prod      *tview.TextView
	ProdState pnp.State
}

func New

func New() *Engine

func (Engine) GameOver

func (e Engine) GameOver()

func (*Engine) GameWon

func (e *Engine) GameWon()

func (Engine) PizzaDelivery

func (e Engine) PizzaDelivery(fn func())

func (*Engine) Reaction

func (e *Engine) Reaction(xp int, health int, player pnp.Player, state pnp.State, action pnp.Action, fn func())

func (Engine) RenderGame

func (e Engine) RenderGame(players []pnp.Player, p pnp.Player)

func (*Engine) RenderPlayers

func (e *Engine) RenderPlayers(players []pnp.Player, current pnp.Player) *tview.Flex

func (*Engine) RenderProd

func (e *Engine) RenderProd()

func (Engine) SelectAction

func (e Engine) SelectAction(player pnp.Player, state pnp.State, onSelect func(action pnp.Action))

func (*Engine) Start

func (e *Engine) Start()

func (*Engine) Stop

func (e *Engine) Stop()

func (*Engine) Welcome

func (e *Engine) Welcome(fn func(bandName string))
type Modal struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewModal

func NewModal() *Modal

func (*Modal) AddButtons

func (m *Modal) AddButtons(labels ...string) *Modal

func (*Modal) SetBackgroundColor

func (m *Modal) SetBackgroundColor(color tcell.Color) *Modal

func (*Modal) SetBorder

func (m *Modal) SetBorder(show bool) *Modal

func (*Modal) SetButtonsAlign

func (m *Modal) SetButtonsAlign(align int) *Modal

func (*Modal) SetDoneFunc

func (m *Modal) SetDoneFunc(done func(buttonIndex int, buttonLabel string)) *Modal

func (*Modal) SetText

func (m *Modal) SetText(text string) *Modal

func (*Modal) SetTextAlign

func (m *Modal) SetTextAlign(align int) *Modal

func (*Modal) SetTextColor

func (m *Modal) SetTextColor(color tcell.Color) *Modal

Jump to

Keyboard shortcuts

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