tui

package
v0.0.0-...-f200c7d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fmt

func Fmt(g MappedGame) string

Types

type Event

type Event int
const (
	Escape Event = iota
	Left
	Right
	Enter
)

type Game

type Game interface {
	Rows() int
	Cols() int
	Get(row, col int) game.Cell
}

type MappedGame

type MappedGame interface {
	Game
	GetTag(row, col int) int
}

type TUI

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

TUI is a UI for the game.

func New

func New(text string, handler func(Event)) (*TUI, error)

New allocates a TUI and takes over the terminal screen.

func (*TUI) Close

func (t *TUI) Close()

Close releases resources and returns the terminal to normal.

func (*TUI) DrawGame

func (t *TUI) DrawGame(g Game)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳