io

package
v0.0.0-...-5f38bd8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2014 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const DEFAULT_COLOR = termbox.ColorDefault
View Source
const EMPTY_SPACE = " "
View Source
const LINE_CHAR = "-"
View Source
const SEPARATOR = " "

Constants

View Source
const TILE_PADDING = 1
View Source
const VERTICAL_BAR = "|"

Variables

This section is empty.

Functions

This section is empty.

Types

type InputHandler

type InputHandler struct{}

func CreateInputHandler

func CreateInputHandler() *InputHandler

func (*InputHandler) ReadInputEvent

func (in *InputHandler) ReadInputEvent() constants.InputEvent

func (*InputHandler) ReadKey

func (in *InputHandler) ReadKey() termbox.Event

We are technically leaking a termbox struct out of this package if someone uses it, but it doesn't really matter in this case (it won't even be used apart from "continues"

type Renderer

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

Actual renderer class Note: Since termbox is being used for this, we could actually not store this and just obtain it from termbox on every redraw. We'll assume no one will really be resizing this while playing though, as even resizing on every redraw would not be good enough (i.e. it would still require a redraw call

func CreateRenderer

func CreateRenderer() *Renderer

func (*Renderer) ClearScreen

func (r *Renderer) ClearScreen()

func (*Renderer) FlushScreen

func (r *Renderer) FlushScreen()

func (*Renderer) RenderPuzzle

func (r *Renderer) RenderPuzzle(p *puzzle.Puzzle)

Puzzle stuff

func (*Renderer) RenderVictoryMessage

func (r *Renderer) RenderVictoryMessage(puzzle *puzzle.Puzzle, stats stats.Stats)

func (*Renderer) RenderWelcomeMessage

func (r *Renderer) RenderWelcomeMessage()

Jump to

Keyboard shortcuts

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