mapgen

package
v0.0.0-...-dfb2563 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCK_NIL          = Block(0)
	BLOCK_AIR          = Block(1)
	BLOCK_DIRT         = Block(2)
	BLOCK_STONE        = Block(3)
	BLOCK_SPAWN        = Block(4)
	BLOCK_GRASS        = Block(5)
	BLOCK_COAL         = Block(6)
	BLOCK_IRON         = Block(7)
	BLOCK_GOLD         = Block(8)
	BLOCK_SAPPHIRE     = Block(9)
	BLOCK_EMERALD      = Block(10)
	BLOCK_RUBY         = Block(11)
	BLOCK_DIAMOND      = Block(12)
	BLOCK_POUDRETTEITE = Block(13)
	BLOCK_GLASS        = Block(14)

	// Properties
	BLOCK_UNMINEABLE = 0x80000000

	// Subtypes
	// Transparent blocks can be seen through, like glass, spawn blocks, etc.
	// We will render faces behind them.
	BLOCK_TRANSPARENT = 1 << 0
	// Invisible blocks are ignored by the renderer, and have no physical
	// manifestation in the world.
	BLOCK_INVISIBLE = (1 << 1) | BLOCK_TRANSPARENT
	// Intangible blocks are ignored by physics simulations, and will
	// allow entities to occupy the same space as them.
	BLOCK_INTANGIBLE = 1 << 2
)

Variables

By default, blocks are visible, tangible, and mineable.

Functions

This section is empty.

Types

type Block

type Block byte

func (Block) Mineable

func (b Block) Mineable() bool

func (Block) Solid

func (b Block) Solid() bool

type BlockSource

type BlockSource interface {
	Block(bc coords.Block) Block
}

type Chunk

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

func GenerateChunk

func GenerateChunk(generator blockGenerator, cc coords.Chunk) *Chunk

func (*Chunk) Block

func (c *Chunk) Block(oc coords.Offset) Block

func (*Chunk) Clone

func (c *Chunk) Clone() *Chunk

TODO: Is this function needed?

func (*Chunk) Each

func (c *Chunk) Each(cb func(oc coords.Offset, block Block))

Calls the given function for each block in the chunk.

func (*Chunk) SetBlock

func (c *Chunk) SetBlock(oc coords.Offset, newBlock Block)

func (*Chunk) ToByteArray

func (c *Chunk) ToByteArray() []byte

type Generator

type Generator interface {
	Chunk(cc coords.Chunk) *Chunk
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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