Documentation ¶
Overview ¶
Package d2mapstamp provides a representation of a preset map which can be used "like a stamp" by the map engine
Index ¶
- type Stamp
- func (mr *Stamp) Entities(tileOffsetX, tileOffsetY int) []d2interface.MapEntity
- func (mr *Stamp) LevelPreset() d2records.LevelPresetRecord
- func (mr *Stamp) LevelType() d2records.LevelTypeRecord
- func (mr *Stamp) RegionID() d2enum.RegionIdType
- func (mr *Stamp) RegionPath() string
- func (mr *Stamp) Size() d2geom.Size
- func (mr *Stamp) Tile(x, y int) *Tile
- func (mr *Stamp) TileData(style, sequence int32, tileType d2enum.TileType) *d2dt1.Tile
- type StampFactory
- type Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stamp ¶
type Stamp struct {
// contains filtered or unexported fields
}
Stamp represents a pre-fabricated map stamp that can be placed on a map.
func (*Stamp) Entities ¶
func (mr *Stamp) Entities(tileOffsetX, tileOffsetY int) []d2interface.MapEntity
Entities spawns all entities and objects in this tile on the map.
func (*Stamp) LevelPreset ¶
func (mr *Stamp) LevelPreset() d2records.LevelPresetRecord
LevelPreset returns the level preset ID.
func (*Stamp) LevelType ¶
func (mr *Stamp) LevelType() d2records.LevelTypeRecord
LevelType returns the level type ID.
func (*Stamp) RegionID ¶
func (mr *Stamp) RegionID() d2enum.RegionIdType
RegionID returns the regionID
func (*Stamp) RegionPath ¶
RegionPath returns the file path of the region.
type StampFactory ¶
StampFactory is responsible for loading map stamps. A stamp can be thought of like a preset map configuration, like the various configurations of Act 1 town.
func NewStampFactory ¶
func NewStampFactory(asset *d2asset.AssetManager, l d2util.LogLevel, entity *d2mapentity.MapEntityFactory) *StampFactory
NewStampFactory creates a MapStamp factory instance
func (*StampFactory) LoadStamp ¶
func (f *StampFactory) LoadStamp(levelType d2enum.RegionIdType, levelPreset, fileIndex int) *Stamp
LoadStamp loads the Stamp data from file, using the given level type, level preset index, and level file index.
type Tile ¶
type Tile struct { Walls []d2ds1.Tile Orientations []d2ds1.Tile Floors []d2ds1.Tile Shadows []d2ds1.Tile Substitutions []d2ds1.Tile }
Tile represents a map tile, which can have a variable amount of floors, walls, shadows as layers. Typically, there will be an Orientation layer for each wall layer.