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 {
|
|
|
|
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
|
|
|
|
}
|
2021-03-29 02:30:10 -04:00
|
|
|
|
|
|
|
func (b *Block) unknown1() []byte {
|
|
|
|
return make([]byte, numUnknownBlockBytes)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *Block) unknown2() []byte {
|
|
|
|
return make([]byte, numUnknownBlockBytes)
|
|
|
|
}
|