terminal

package
v0.0.0-...-ee56373 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Displayer

type Displayer interface {
	Rune(cx, cy int, x, y uint16, t *tile.State) rune
}

Displayer is the interface all tile displayers must implement.

func DefaultBlocks

func DefaultBlocks() []Displayer

func DefaultFloors

func DefaultFloors() []Displayer

type Driver

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

Driver is the terminal driver struct.

func New

func New() *Driver

New creates a new Driver with a new game instance.

func (*Driver) Clear

func (d *Driver) Clear()

func (*Driver) Draw

func (d *Driver) Draw(app *game.Application)

func (*Driver) Finalize

func (d *Driver) Finalize()

Finalize releases terminal driver resources.

func (*Driver) HandleKeyEventGame

func (d *Driver) HandleKeyEventGame(app *game.Application, event *tcell.EventKey) game.Action

func (*Driver) HandleKeyEventMenu

func (d *Driver) HandleKeyEventMenu(app *game.Application, event *tcell.EventKey) game.Action

func (*Driver) Init

func (d *Driver) Init() error

Init initializes the terminal driver.

func (*Driver) PollAction

func (d *Driver) PollAction(app *game.Application) game.Action

PollAction gets the next action to update the game with.

func (*Driver) SetLog

func (d *Driver) SetLog(filename string) error

SetLog sets the logging behavior of the driver.

As the driver makes use of the standard log package, this will set the filename to redirect the log package to. If filename is the empty string, this will result in a NopCloser

type LiquidNumber

type LiquidNumber struct{}

LiquidNumber is a displayer for liquids which shows their depth.

func (LiquidNumber) Rune

func (l LiquidNumber) Rune(cx, cy int, x, y uint16, t *tile.State) rune

type Random

type Random []rune

Random is a displayer which chooses a 'pseudo-random' tile to display based on the coordinates.

func (Random) Rune

func (r Random) Rune(cx, cy int, x, y uint16, t *tile.State) rune

type Simple

type Simple rune

Simple is a displayer which only ever returns a single rune.

func (Simple) Rune

func (s Simple) Rune(cx, cy int, x, y uint16, t *tile.State) rune

Jump to

Keyboard shortcuts

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