world

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NodeSizeInBytes = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	GetBlockData(pos spatial.BlockPosition) ([]byte, error)
	Close()
}

type MapBlock

type MapBlock struct {
	// contains filtered or unexported fields
}

func DecodeMapBlock

func DecodeMapBlock(data []byte) (*MapBlock, error)

func (*MapBlock) GetNode

func (b *MapBlock) GetNode(pos spatial.NodePosition) Node

func (*MapBlock) ResolveName

func (b *MapBlock) ResolveName(id uint16) string

type Node

type Node struct {
	ID     uint16
	Param1 uint8
	Param2 uint8
}

type PostgresBackend

type PostgresBackend struct {
	// contains filtered or unexported fields
}

func NewPostgresBackend

func NewPostgresBackend(dsn string) (*PostgresBackend, error)

func (*PostgresBackend) Close

func (p *PostgresBackend) Close()

func (*PostgresBackend) GetBlockData

func (p *PostgresBackend) GetBlockData(pos spatial.BlockPosition) ([]byte, error)

type ReaderCounter

type ReaderCounter struct {
	// contains filtered or unexported fields
}

func NewReaderCounter

func NewReaderCounter(r *bytes.Reader) *ReaderCounter

func (*ReaderCounter) Read

func (r *ReaderCounter) Read(p []byte) (n int, err error)

func (*ReaderCounter) ReadByte

func (r *ReaderCounter) ReadByte() (byte, error)

type World

type World struct {
	// contains filtered or unexported fields
}

func NewWorldWithBackend

func NewWorldWithBackend(backend Backend) World

func (*World) GetBlock

func (w *World) GetBlock(pos spatial.BlockPosition) (*MapBlock, error)

Jump to

Keyboard shortcuts

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