otbm

package
Version: v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package otbm implements an OTBM map file format reader and a gameworld map data source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemAttribute

type ItemAttribute uint8
const (
	OTBM_ATTR_DESCRIPTION    ItemAttribute = 0x01
	OTBM_ATTR_EXT_FILE       ItemAttribute = 0x02
	OTBM_ATTR_TILE_FLAGS     ItemAttribute = 0x03
	OTBM_ATTR_ACTION_ID      ItemAttribute = 0x04
	OTBM_ATTR_UNIQUE_ID      ItemAttribute = 0x05
	OTBM_ATTR_TEXT           ItemAttribute = 0x06
	OTBM_ATTR_DESC           ItemAttribute = 0x07
	OTBM_ATTR_TELE_DEST      ItemAttribute = 0x08
	OTBM_ATTR_ITEM           ItemAttribute = 0x09
	OTBM_ATTR_DEPOT_ID       ItemAttribute = 0x0A
	OTBM_ATTR_EXT_SPAWN_FILE ItemAttribute = 0x0B
	OTBM_ATTR_RUNE_CHARGES   ItemAttribute = 0x0C
	OTBM_ATTR_EXT_HOUSE_FILE ItemAttribute = 0x0D
	OTBM_ATTR_HOUSEDOORID    ItemAttribute = 0x0E
	OTBM_ATTR_COUNT          ItemAttribute = 0x0F
	OTBM_ATTR_DURATION       ItemAttribute = 0x10
	OTBM_ATTR_DECAYING_STATE ItemAttribute = 0x11
	OTBM_ATTR_WRITTENDATE    ItemAttribute = 0x12
	OTBM_ATTR_WRITTENBY      ItemAttribute = 0x13
	OTBM_ATTR_SLEEPERGUID    ItemAttribute = 0x14
	OTBM_ATTR_SLEEPSTART     ItemAttribute = 0x15
	OTBM_ATTR_CHARGES        ItemAttribute = 0x16

	OTBM_ATTR_ATTRIBUTE_MAP ItemAttribute = 128
)

func (ItemAttribute) String

func (a ItemAttribute) String() string

type Map

type Map struct {
	gameworld.MapDataSource
	// contains filtered or unexported fields
}

func New

func New(r io.ReadSeeker, t *things.Things) (*Map, error)

New reads an OTB file from a given reader.

func (*Map) AddCreature

func (m *Map) AddCreature(c gameworld.Creature) error

func (*Map) GetCreatureByID

func (m *Map) GetCreatureByID(id gameworld.CreatureID) (gameworld.Creature, error)

func (*Map) GetCreatureByIDBytes

func (m *Map) GetCreatureByIDBytes(idBytes [4]byte) (gameworld.Creature, error)

func (*Map) GetMapTile

func (m *Map) GetMapTile(x, y uint16, z uint8) (gameworld.MapTile, error)

func (*Map) Private_And_Temp__DefaultPlayerSpawnPoint

func (m *Map) Private_And_Temp__DefaultPlayerSpawnPoint(c gameworld.CreatureID) tnet.Position

func (*Map) RemoveCreatureByID

func (m *Map) RemoveCreatureByID(id gameworld.CreatureID) error

func (*Map) String

func (m *Map) String() string

type MapData

type MapData interface{}

type MapNodeType

type MapNodeType uint8

Implementation detail: iota is not used primarily for easier referencing in case of an error.

const (
	OTBM_ROOT        MapNodeType = 0x00
	OTBM_ROOTV1      MapNodeType = 0x01
	OTBM_MAP_DATA    MapNodeType = 0x02
	OTBM_ITEM_DEF    MapNodeType = 0x03
	OTBM_TILE_AREA   MapNodeType = 0x04
	OTBM_TILE        MapNodeType = 0x05
	OTBM_ITEM        MapNodeType = 0x06
	OTBM_TILE_SQUARE MapNodeType = 0x07
	OTBM_TILE_REF    MapNodeType = 0x08
	OTBM_SPAWNS      MapNodeType = 0x09
	OTBM_SPAWN_AREA  MapNodeType = 0x0A
	OTBM_MONSTER     MapNodeType = 0x0B
	OTBM_TOWNS       MapNodeType = 0x0C
	OTBM_TOWN        MapNodeType = 0x0D
	OTBM_HOUSETILE   MapNodeType = 0x0E
	OTBM_WAYPOINTS   MapNodeType = 0x0F
	OTBM_WAYPOINT    MapNodeType = 0x10
)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL