switchboard

package
v0.0.0-...-9db1a63 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeBlock

func MakeBlock(cells []*ASCIISwitchboardCell, kind ASCIICellType)

func MakeLabel

func MakeLabel(cells []*ASCIISwitchboardCell, kind ASCIICellType)

Types

type ASCIICellConnection

type ASCIICellConnection int
const (
	ConnectTop    ASCIICellConnection = 1
	ConnectRight  ASCIICellConnection = 2
	ConnectBottom ASCIICellConnection = 4
	ConnectLeft   ASCIICellConnection = 8
)

type ASCIICellType

type ASCIICellType int
const (
	UnprocessedCell ASCIICellType = iota
	SwitchVerticalDiagonalUpper
	SwitchVerticalDiagonalBackUpper
	SwitchVerticalDiagonalBackLower
	SwitchVerticalDiagonalLower
	SwitchHorizontalDiagonalUpper
	SwitchHorizontalDiagonalBackUpper
	SwitchHorizontalDiagonalBackLower
	SwitchHorizontalDiagonalLower
	SwitchVerticalCrossDiagonal
	SwitchVerticalCrossDiagonalBack
	SwitchHorizontalCrossDiagonal
	SwitchHorizontalCrossDiagonalBack
)
const (
	TrackHorizontal ASCIICellType = 20 + iota
	TrackVertical
	TrackDiagonalUpper
	TrackDiagonalLower
	TrackDiagonalBackUpper
	TrackDiagonalBackLower
	TrackHorizontalStopRight
	TrackHorizontalStopLeft
	TrackVerticalStopTop
	TrackVerticalStopBottom
	TrackHorizontalBlock
	TrackVerticalBlock
	TrackHorizontalLabel
	TrackVerticalLabel
)
const (
	// Used internally only by the interpreter
	SwitchHorizontalSlash ASCIICellType = 256
	// Used internally only by the interpreter
	SwitchVerticalSlash ASCIICellType = 512
	// Used internally only by the interpreter
	SwitchHorizontalBackslash ASCIICellType = 1024
	// Used internally only by the interpreter
	SwitchVerticalBackslash ASCIICellType = 2048
)
const (
	// Used internally only, not understood by the HTML UI
	TrackDoubleBackslash ASCIICellType = iota + 3000
	// Used internally only, not understood by the HTML UI
	TrackDoubleSlash
)

type ASCIISwitchboard

type ASCIISwitchboard struct {
	LineCount   int
	ColumnCount int
	Lines       []string
	Cells       []ASCIISwitchboardCell
	Location    errlog.LocationRange
}

* ASCIISwitchboard holds an ASCII representation of a switchboard. * Instances of this type are created while interpreting *.via files.

func (*ASCIISwitchboard) Cell

func (*ASCIISwitchboard) CellAbove

func (l *ASCIISwitchboard) CellAbove(x int, y int) *ASCIISwitchboardCell

func (*ASCIISwitchboard) CellBelow

func (l *ASCIISwitchboard) CellBelow(x int, y int) *ASCIISwitchboardCell

func (*ASCIISwitchboard) CellLeftOf

func (l *ASCIISwitchboard) CellLeftOf(x int, y int) *ASCIISwitchboardCell

func (*ASCIISwitchboard) CellRightOf

func (l *ASCIISwitchboard) CellRightOf(x int, y int) *ASCIISwitchboardCell

type ASCIISwitchboardCell

type ASCIISwitchboardCell struct {
	Type        ASCIICellType
	Connections ASCIICellConnection
	Rune        rune
	X           int
	Y           int
	Text        string
	Anchor      *ASCIISwitchboardCell
}

func (*ASCIISwitchboardCell) ConnectsToBottom

func (c *ASCIISwitchboardCell) ConnectsToBottom() bool

func (*ASCIISwitchboardCell) ConnectsToLeft

func (c *ASCIISwitchboardCell) ConnectsToLeft() bool

func (*ASCIISwitchboardCell) ConnectsToRight

func (c *ASCIISwitchboardCell) ConnectsToRight() bool

func (*ASCIISwitchboardCell) ConnectsToTop

func (c *ASCIISwitchboardCell) ConnectsToTop() bool

Jump to

Keyboard shortcuts

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