1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-20 06:05:23 +00:00
OpenDiablo2/d2common/d2fileformats/d2dt1/material.go
gravestench 6f8b43f8d6
Various lint error fixes and suppressions (#846)
* suppressing the magic number lint errors in mapgen, it will get a heavy refactor soon, hopefully...

* adding string token constants for SkillClass

* adding panic on error to left/right skill select render

* fixed cuddle lint error

* fixed unnecessary conversion, unused func param lint errors in dcc_animation.go

* adding comment for skill class tokens

* fixed typo in comment

* removed unused parameter in dcc/dc6 animations

* supress warning about Object.setMode always being passed direction value of 0

* fixed all invalid golint directives

* fixed a couple gocritic lint errors
2020-10-26 02:04:50 -07:00

33 lines
865 B
Go

package d2dt1
// MaterialFlags represents the material flags. Lots of unknowns for now...
type MaterialFlags struct {
Other bool
Water bool
WoodObject bool
InsideStone bool
OutsideStone bool
Dirt bool
Sand bool
Wood bool
Lava bool
Snow bool
}
// NewMaterialFlags represents the material flags
// nolint:gomnd // Binary values
func NewMaterialFlags(data uint16) MaterialFlags {
return MaterialFlags{
Other: data&0x0001 == 0x0001,
Water: data&0x0002 == 0x0002,
WoodObject: data&0x0004 == 0x0004,
InsideStone: data&0x0008 == 0x0008,
OutsideStone: data&0x0010 == 0x0010,
Dirt: data&0x0020 == 0x0020,
Sand: data&0x0040 == 0x0040,
Wood: data&0x0080 == 0x0080,
Lava: data&0x0100 == 0x0100,
Snow: data&0x0400 == 0x0400,
}
}