lvl

package
v0.0.0-...-4ede3f3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ability

type Ability uint16

It should deprecate the block field.

type Graph

type Graph struct {
	Tset *Tset
	Grid *Grid
	// contains filtered or unexported fields
}

func (*Graph) FindPath

func (g *Graph) FindPath(from, to geo.Pos, a Ability) ([]pfind.Node, error)

func (*Graph) Heur

func (g *Graph) Heur() pfind.Heur

func (*Graph) Near

func (g *Graph) Near(p geo.Pos, f func(geo.Pos, int))

type Grid

type Grid struct {
	ID ids.Grid `json:"id"`
	grid.Tiles[Tile]
}

func (*Grid) Make

func (*Grid) Make(id uint32) Grid

func (*Grid) MarshalBinary

func (g *Grid) MarshalBinary() ([]byte, error)

func (*Grid) UID

func (g *Grid) UID() uint32

func (*Grid) UnmarshalBinary

func (g *Grid) UnmarshalBinary(raw []byte) error

type GridTable

type GridTable = ids.ListTable[ids.Grid, Grid, *Grid]

type Lvl

type Lvl struct {
	ID   ids.Lvl `json:"id"`
	Name string  `json:"name"`
	geo.Dim
	Tset ids.Tset `json:"tset"`
	Grid ids.Grid `json:"grid"`
}

func (*Lvl) Make

func (*Lvl) Make(id uint32) Lvl

func (*Lvl) MarshalBinary

func (l *Lvl) MarshalBinary() ([]byte, error)

func (*Lvl) Named

func (l *Lvl) Named() string

func (*Lvl) UID

func (l *Lvl) UID() uint32

func (*Lvl) UnmarshalBinary

func (l *Lvl) UnmarshalBinary(raw []byte) error

type LvlTable

type LvlTable = ids.ListTable[ids.Lvl, Lvl, *Lvl]

type Sys

type Sys struct {
	Tset TsetTable
	Lvl  LvlTable
	Grid GridTable
	// contains filtered or unexported fields
}

Sys is the tileset and level system.

func (*Sys) DelLvl

func (s *Sys) DelLvl(id ids.Lvl) error

func (*Sys) DelTset

func (s *Sys) DelTset(id ids.Tset) error

func (*Sys) Graph

func (s *Sys) Graph(lvl ids.Lvl) (*Graph, error)

func (*Sys) NewLvl

func (s *Sys) NewLvl(req Lvl) (*Lvl, error)

func (*Sys) NewTset

func (s *Sys) NewTset(name string) (*Tset, error)

type Tile

type Tile uint16

type TileInfo

type TileInfo struct {
	Tile Tile `json:"tile"`
	// Allow is a bitmask that indicates what ability is required to traverse to or over this
	// tile. It should deprecate the block field.
	Allow Ability   `json:"allow,omitempty"`
	Color uint32    `json:"color"`
	Name  string    `json:"name"`
	Block bool      `json:"block,omitempty"`
	Group string    `json:"group,omitempty"`
	Asset ids.Topic `json:"asset,omitempty"`
}

type Tset

type Tset struct {
	ID    ids.Tset   `json:"id"`
	Name  string     `json:"name"`
	Infos []TileInfo `json:"infos"`
}

func (*Tset) Make

func (*Tset) Make(id uint32) Tset

func (*Tset) MarshalBinary

func (ts *Tset) MarshalBinary() ([]byte, error)

func (*Tset) Named

func (ts *Tset) Named() string

func (*Tset) UID

func (ts *Tset) UID() uint32

func (*Tset) UnmarshalBinary

func (ts *Tset) UnmarshalBinary(raw []byte) error

type TsetTable

type TsetTable = ids.ListTable[ids.Tset, Tset, *Tset]

Jump to

Keyboard shortcuts

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