2020-01-26 00:39:13 -05:00
|
|
|
package d2dt1
|
|
|
|
|
2020-06-28 22:32:34 -04:00
|
|
|
// Block represents a DT1 block
|
2020-01-26 00:39:13 -05:00
|
|
|
type Block struct {
|
2021-02-02 13:25:27 -05:00
|
|
|
unknown1 []byte
|
|
|
|
unknown2 []byte
|
2020-01-26 00:39:13 -05:00
|
|
|
X int16
|
|
|
|
Y int16
|
|
|
|
GridX byte
|
|
|
|
GridY byte
|
2021-02-02 13:25:27 -05:00
|
|
|
format int16
|
2020-01-26 00:39:13 -05:00
|
|
|
EncodedData []byte
|
|
|
|
Length int32
|
|
|
|
FileOffset int32
|
|
|
|
}
|
2021-02-02 13:25:27 -05:00
|
|
|
|
|
|
|
// Format returns block format
|
|
|
|
func (b *Block) Format() BlockDataFormat {
|
|
|
|
if b.format == 1 {
|
|
|
|
return BlockFormatIsometric
|
|
|
|
}
|
|
|
|
|
|
|
|
return BlockFormatRLE
|
|
|
|
}
|