Documentation
¶
Index ¶
- Variables
- func ReadBytes(r io.Reader) (p []byte, err error)
- func ReadDynamic(r io.Reader) (v interface{}, err error)
- func ReadList(r io.Reader) (l []interface{}, err error)
- func ReadMap(r io.Reader) (m map[string]interface{}, err error)
- func ReadString(r io.Reader) (s string, err error)
- func ReadVarint(r io.Reader) (v int64, err error)
- func ReadVaruint(r io.Reader) (v uint64, err error)
- type BTreeDB5
- type IndexEntry
- type LeafReader
- type SBAsset6
- type Tile
- type VersionedJSON
- type World
Constants ¶
This section is empty.
Variables ¶
var ( BTreeDB5BlockFree = []byte("FF") BTreeDB5BlockIndex = []byte("II") BTreeDB5BlockLeaf = []byte("LL") )
Functions ¶
func ReadDynamic ¶
Types ¶
type BTreeDB5 ¶
type IndexEntry ¶
type IndexEntry struct {
Offset, Size int64
}
type LeafReader ¶
type LeafReader struct {
// contains filtered or unexported fields
}
func NewLeafReader ¶
func NewLeafReader(db *BTreeDB5, block int) *LeafReader
func (*LeafReader) Read ¶
func (l *LeafReader) Read(p []byte) (n int, err error)
Reads n bytes from the LeafReader, jumping to the next leaf when necessary.
func (*LeafReader) Skip ¶
func (l *LeafReader) Skip(n int) error
Increments the LeafReader pointer by n bytes. This may require several reads from the underlying ReaderAt as the LeafReader reaches the boundary of the current leaf.
type SBAsset6 ¶
type SBAsset6 struct {
FileCount int
Index map[string]IndexEntry
Metadata map[string]interface{}
// contains filtered or unexported fields
}
type Tile ¶
type Tile struct {
ForegroundMaterial int16
ForegroundHueShift uint8
ForegroundVariant uint8
ForegroundMod int16
ForegroundModHueShift uint8
BackgroundMaterial int16
BackgroundHueShift uint8
BackgroundVariant uint8
BackgroundMod int16
BackgroundModHueShift uint8
Liquid uint8
LiquidLevel float32
LiquidPressure float32
LiquidInfinite bool
Collision uint8
DungeonID uint16
Biome1, Biome2 uint8
Indestructible bool
}
type VersionedJSON ¶
VersionedJSON represents a JSON-compatible data structure which additionally has a name and version associated with it so that the reader may migrate the structure based on the name/version.
func ReadVersionedJSON ¶
func ReadVersionedJSON(r io.Reader) (v VersionedJSON, err error)
func (*VersionedJSON) List ¶
func (v *VersionedJSON) List(keys ...string) []interface{}
Gets the list at the specified key path if there is one; otherwise, nil.
func (*VersionedJSON) Map ¶
func (v *VersionedJSON) Map(keys ...string) map[string]interface{}
Gets the map at the specified key path if there is one; otherwise, nil.
func (*VersionedJSON) Value ¶
func (v *VersionedJSON) Value(keys ...string) interface{}
Gets the value at a specific key path if there is one; otherwise, nil.
type World ¶
type World struct {
*BTreeDB5
Metadata VersionedJSON
Width, Height int
}
A World is a representation of a Starbound world, enabling read access to individual regions in the world as well as its metadata.
func (*World) GetEntities ¶
func (w *World) GetEntities(x, y int) (e []VersionedJSON, err error)