area

package
v0.0.0-...-ad3cfc1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	Rows, Cols int

	Fixed bool
	// contains filtered or unexported fields
}

Area represents a rectangular area of Chars. An empty Area is a valid one.

func (*Area) Each

func (a *Area) Each(fn func(Row, Col int, char Char))

Each iterates over each column and row. The rows and the columns starts with 1

func (*Area) Get

func (a *Area) Get(Row, Col int) (Char, error)

Get will return the character at the given position. A row or col smaller than 1 will return nil and error. For a fixed area a row and col bigger than the actual size will also return an error

func (*Area) Set

func (a *Area) Set(row, col int, c Char) error

Set will change the given Char in the row,col position. If the area is fixed, it will return an error if a char is being set outside the area A row or col smaller than 1 will also return an error

func (*Area) SetSize

func (a *Area) SetSize(rows, cols int)

SetSize changes the current area size an sets the area to Fixed.

func (*Area) Size

func (a *Area) Size() (rows, cols int)

Size returns the current Size.

type Char

type Char interface{}

Char represent a given Character in an area

Jump to

Keyboard shortcuts

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