grid

package
v0.0.0-...-a081121 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Pos                                      Point
	North, South, East, West                 *Cell
	ExitNorth, ExitSouth, ExitEast, ExitWest bool
	Text                                     string
	// contains filtered or unexported fields
}

Cell represents a single cell in the grid

func (*Cell) Clicked

func (c *Cell) Clicked()

type Grid

type Grid struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Grid represents a selection of cells making up a maze

func New

func New(width, height int) *Grid

New creates and returns a pointer to a new grid

func (*Grid) BinaryTree

func (g *Grid) BinaryTree()

func (*Grid) CellAt

func (g *Grid) CellAt(p Point) *Cell

func (*Grid) Empty

func (g *Grid) Empty()

func (*Grid) Height

func (g *Grid) Height() int

func (*Grid) RequiresRefresh

func (g *Grid) RequiresRefresh() chan Point

func (*Grid) Reset

func (g *Grid) Reset()

func (*Grid) Route

func (g *Grid) Route()

func (*Grid) Sidewinder

func (g *Grid) Sidewinder()

func (*Grid) Width

func (g *Grid) Width() int

type Point

type Point struct {
	X int
	Y int
}

Point is an x/y coordinate

Jump to

Keyboard shortcuts

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