Versions in this module Expand all Collapse all v0 v0.23.0 Aug 23, 2023 Changes in this version + type Cell int + type CellularAutomataRule struct + Reps int + WCutoff1 int + WCutoff2 int + WallsOutOfRange bool + type Event interface + type EventQueue struct + func NewEventQueue() *EventQueue + func (eq *EventQueue) Empty() bool + func (eq *EventQueue) Filter(fn func(ev Event) bool) + func (eq *EventQueue) GobDecode(bs []byte) error + func (eq *EventQueue) GobEncode() ([]byte, error) + func (eq *EventQueue) Pop() Event + func (eq *EventQueue) PopR() (Event, int) + func (eq *EventQueue) Push(ev Event, rank int) + func (eq *EventQueue) PushFirst(ev Event, rank int) + type FOV struct + func NewFOV(rg gruid.Range) *FOV + func (fov *FOV) At(p gruid.Point) (int, bool) + func (fov *FOV) From(lt Lighter, to gruid.Point) (LightNode, bool) + func (fov *FOV) GobDecode(bs []byte) error + func (fov *FOV) GobEncode() ([]byte, error) + func (fov *FOV) Iter(fn func(LightNode)) + func (fov *FOV) IterSSC(fn func(p gruid.Point)) + func (fov *FOV) LightMap(lt Lighter, srcs []gruid.Point) []LightNode + func (fov *FOV) Range() gruid.Range + func (fov *FOV) Ray(lt Lighter, to gruid.Point) []LightNode + func (fov *FOV) SSCLightMap(srcs []gruid.Point, maxDepth int, passable func(p gruid.Point) bool, ...) []gruid.Point + func (fov *FOV) SSCVisionMap(src gruid.Point, maxDepth int, passable func(p gruid.Point) bool, diags bool) []gruid.Point + func (fov *FOV) SetRange(rg gruid.Range) + func (fov *FOV) Visible(p gruid.Point) bool + func (fov *FOV) VisionMap(lt Lighter, src gruid.Point) []LightNode + type Grid struct + func NewGrid(w, h int) Grid + func (gd *Grid) GobDecode(bs []byte) error + func (gd *Grid) GobEncode() ([]byte, error) + func (gd Grid) At(p gruid.Point) Cell + func (gd Grid) AtU(p gruid.Point) Cell + func (gd Grid) Bounds() gruid.Range + func (gd Grid) Contains(p gruid.Point) bool + func (gd Grid) Copy(src Grid) gruid.Point + func (gd Grid) Count(c Cell) int + func (gd Grid) CountFunc(fn func(c Cell) bool) int + func (gd Grid) Fill(c Cell) + func (gd Grid) FillFunc(fn func() Cell) + func (gd Grid) Iter(fn func(gruid.Point, Cell)) + func (gd Grid) Iterator() GridIterator + func (gd Grid) Map(fn func(gruid.Point, Cell) Cell) + func (gd Grid) Range() gruid.Range + func (gd Grid) Resize(w, h int) Grid + func (gd Grid) Set(p gruid.Point, c Cell) + func (gd Grid) Size() gruid.Point + func (gd Grid) Slice(rg gruid.Range) Grid + type GridIterator struct + func (it *GridIterator) Cell() Cell + func (it *GridIterator) Next() bool + func (it *GridIterator) P() gruid.Point + func (it *GridIterator) Reset() + func (it *GridIterator) SetCell(c Cell) + func (it *GridIterator) SetP(p gruid.Point) + type LightNode struct + Cost int + P gruid.Point + type Lighter interface + Cost func(src gruid.Point, from gruid.Point, to gruid.Point) int + MaxCost func(src gruid.Point) int + type MapGen struct + Grid Grid + Rand *rand.Rand + func (mg MapGen) CellularAutomataCave(wall, ground Cell, winit float64, rules []CellularAutomataRule) int + func (mg MapGen) KeepCC(pr *paths.PathRange, p gruid.Point, wall Cell) int + func (mg MapGen) RandomWalkCave(walker RandomWalker, c Cell, fillp float64, walks int) int + func (mg MapGen) WithGrid(gd Grid) MapGen + type RandomWalker interface + Neighbor func(gruid.Point) gruid.Point + type Vault struct + func NewVault(s string) (*Vault, error) + func (v *Vault) Content() string + func (v *Vault) Draw(gd Grid, fn func(rune) Cell) Grid + func (v *Vault) Iter(fn func(gruid.Point, rune)) + func (v *Vault) Parse(s string) error + func (v *Vault) Reflect() + func (v *Vault) Rotate(n int) + func (v *Vault) Runes() string + func (v *Vault) SetRunes(s string) + func (v *Vault) Size() gruid.Point