console

package
v0.0.0-...-f3028fa Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPollNoCommand = errors.New("PollNoCommand")

Functions

This section is empty.

Types

type Console

type Console struct {
	// contains filtered or unexported fields
}

A console client.

func New

func New() *Console

Create a new console client.

func (*Console) Close

func (c *Console) Close()

Tear down the console client.

func (*Console) HandleEvent

func (c *Console) HandleEvent(ev game.Event)

Handle an event generated by the game after the last command.

func (*Console) Init

func (c *Console) Init() error

Init the console client.

func (*Console) Poll

func (c *Console) Poll() (game.Command, error)

Get the next command from the player to be sent to the game instance.

func (*Console) Render

func (c *Console) Render(g *game.Game)

Render the current screen on this console.

type InputHandler

type InputHandler interface {
	HandleInput(termbox.Event) (game.Command, error)
}

Jump to

Keyboard shortcuts

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