Documentation ¶
Overview ¶
Package d2ds1 provides functionality for loading/processing DS1 Files
Index ¶
- func GetMaxGroupLen(t LayerGroupType) (max int)
- type DS1
- func (l DS1) DeleteFloor(idx int)
- func (l DS1) DeleteShadow(idx int)
- func (l DS1) DeleteSubstitution(idx int)
- func (l DS1) DeleteWall(idx int)
- func (l DS1) GetFloor(idx int) *Layer
- func (l DS1) GetLayersGroup(t LayerGroupType) (group *layerGroup)
- func (l DS1) GetShadow(idx int) *Layer
- func (l DS1) GetSubstitution(idx int) *Layer
- func (l DS1) GetWall(idx int) *Layer
- func (l DS1) Height() int
- func (l DS1) InsertFloor(idx int, newFloor *Layer)
- func (l DS1) InsertShadow(idx int, newShadow *Layer)
- func (l DS1) InsertSubstitution(idx int, newSubstitution *Layer)
- func (l DS1) InsertWall(idx int, newWall *Layer)
- func (ds1 *DS1) Marshal() []byte
- func (l DS1) PopFloor() *Layer
- func (l DS1) PopShadow() *Layer
- func (l DS1) PopSubstitution() *Layer
- func (l DS1) PopWall() *Layer
- func (l DS1) PushFloor(floor *Layer) *ds1Layers
- func (l DS1) PushShadow(shadow *Layer) *ds1Layers
- func (l DS1) PushSubstitution(sub *Layer) *ds1Layers
- func (l DS1) PushWall(wall *Layer) *ds1Layers
- func (l DS1) SetHeight(h int)
- func (ds1 *DS1) SetSize(w, h int)
- func (ds1 *DS1) SetVersion(v int)
- func (l DS1) SetWidth(w int)
- func (l DS1) Size() (w, h int)
- func (ds1 *DS1) Unmarshal(fileData []byte) (*DS1, error)
- func (ds1 *DS1) Version() int
- func (l DS1) Width() int
- type Layer
- type LayerGroupType
- type Object
- type SubstitutionGroup
- type Tile
- func (t *Tile) DecodeFloor(dw uint32)
- func (t *Tile) DecodeShadow(dw uint32)
- func (t *Tile) DecodeWall(dw uint32)
- func (t *Tile) EncodeFloor(sw *d2datautils.StreamWriter)
- func (t *Tile) EncodeShadow(sw *d2datautils.StreamWriter)
- func (t *Tile) EncodeWall(sw *d2datautils.StreamWriter)
- func (t *Tile) Hidden() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMaxGroupLen ¶
func GetMaxGroupLen(t LayerGroupType) (max int)
GetMaxGroupLen returns maximum length of layer group of type given
Types ¶
type DS1 ¶
type DS1 struct { Files []string // FilePtr table of file string pointers Objects []Object // Objects SubstitutionGroups []SubstitutionGroup // Substitution groups for the DS1 Act int32 // Act, from 1 to 5. This tells which Act table to use for the Objects list SubstitutionType int32 // SubstitutionType (layer type): 0 if no layer, else type 1 or type 2 // contains filtered or unexported fields }
DS1 represents the "stamp" data that is used to build up maps.
func (DS1) DeleteFloor ¶
func (l DS1) DeleteFloor(idx int)
func (DS1) DeleteShadow ¶
func (l DS1) DeleteShadow(idx int)
func (DS1) DeleteSubstitution ¶
func (l DS1) DeleteSubstitution(idx int)
func (DS1) DeleteWall ¶
func (l DS1) DeleteWall(idx int)
func (DS1) GetLayersGroup ¶
func (l DS1) GetLayersGroup(t LayerGroupType) (group *layerGroup)
GetLayersGroup returns layer group depending on type given
func (DS1) GetSubstitution ¶
func (DS1) InsertFloor ¶
func (DS1) InsertShadow ¶
func (DS1) InsertSubstitution ¶
func (DS1) InsertWall ¶
func (DS1) PopSubstitution ¶
func (l DS1) PopSubstitution() *Layer
func (DS1) PushShadow ¶
func (l DS1) PushShadow(shadow *Layer) *ds1Layers
func (DS1) PushSubstitution ¶
func (l DS1) PushSubstitution(sub *Layer) *ds1Layers
func (*DS1) SetVersion ¶
SetVersion sets the ds1 version, can not be negative.
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer is an abstraction of a tile grid with some helper methods
type LayerGroupType ¶
type LayerGroupType int
LayerGroupType represents a type of layer (floor, wall, shadow, etc)
const ( FloorLayerGroup LayerGroupType = iota WallLayerGroup ShadowLayerGroup SubstitutionLayerGroup )
Layer group types
func (LayerGroupType) String ¶
func (l LayerGroupType) String() string
type SubstitutionGroup ¶
type SubstitutionGroup struct { TileX int32 TileY int32 WidthInTiles int32 HeightInTiles int32 Unknown int32 }
SubstitutionGroup represents a substitution group in a DS1 file.
type Tile ¶
type Tile struct {
// contains filtered or unexported fields
}
Tile represents a tile record in a DS1 file.
func (*Tile) DecodeFloor ¶
DecodeFloor decodes as a floor record
func (*Tile) DecodeShadow ¶
DecodeShadow decodes as a shadow record
func (*Tile) EncodeFloor ¶
func (t *Tile) EncodeFloor(sw *d2datautils.StreamWriter)
EncodeFloor adds Floor's bits to stream writer given
func (*Tile) EncodeShadow ¶
func (t *Tile) EncodeShadow(sw *d2datautils.StreamWriter)
EncodeShadow adds shadow's bits to stream writer given
func (*Tile) EncodeWall ¶
func (t *Tile) EncodeWall(sw *d2datautils.StreamWriter)
EncodeWall adds wall's record's bytes into stream writer given