mtmap

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSerializeVer = errors.New("invalid serialize version")
	ErrInvalidContentWidth = errors.New("invalid content width")
	ErrInvalidParamsWidth  = errors.New("invalid params width")
	ErrInvalidNodeMetaVer  = errors.New("invalid node meta version")
	ErrInvalidNameIdMapVer = errors.New("invalid name id mapping version")
	ErrInvalidStaticObjVer = errors.New("invalid static object version")
)
View Source
var (
	SerializeVer uint8 = 28
	ContentWidth uint8 = 2
	ParamsWidth  uint8 = 2
	NodeMetaVer  uint8 = 2
	StaticObjVer uint8 = 0
	NameIdMapVer uint8 = 0
)

Functions

func Serialize

func Serialize(blk *MapBlk, w io.Writer, nameIdMap map[mt.Content]string)

Types

type MapBlk

type MapBlk struct {
	mt.MapBlk
	Flags            MapBlkFlags
	LightingComplete uint16
	StaticObjs       []StaticObj
	Timestamp        uint32
}

func Deserialize

func Deserialize(r io.Reader, idNameMap map[string]mt.Content) *MapBlk

type MapBlkFlags

type MapBlkFlags uint8
const (
	IsUnderground MapBlkFlags = 1 << iota
	DayNightDiffers
	NotGenerated = 1 << 4
)

type StaticObj

type StaticObj struct {
	Type uint8
	Pos  [3]float32
	Data string
}

Jump to

Keyboard shortcuts

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