d2mapstamp

package
v0.0.0-...-7f92c57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package d2mapstamp provides a representation of a preset map which can be used "like a stamp" by the map engine

Index

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

func (mr *Stamp) RegionPath() string

RegionPath returns the file path of the region.

func (*Stamp) Size

func (mr *Stamp) Size() d2geom.Size

Size returns the size of the stamp in tiles.

func (*Stamp) Tile

func (mr *Stamp) Tile(x, y int) *Tile

Tile returns the tile at the given x and y tile coordinates.

func (*Stamp) TileData

func (mr *Stamp) TileData(style, sequence int32, tileType d2enum.TileType) *d2dt1.Tile

TileData returns the tile data for the tile with given style, sequence and type.

type StampFactory

type StampFactory struct {
	*d2util.Logger
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

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