2020-01-26 00:39:13 -05:00
|
|
|
package d2dt1
|
|
|
|
|
2020-06-28 22:32:34 -04:00
|
|
|
// SubTileFlags represent the sub-tile flags for a DT1
|
2020-01-26 00:39:13 -05:00
|
|
|
type SubTileFlags struct {
|
2020-04-11 14:56:47 -04:00
|
|
|
BlockWalk bool
|
|
|
|
BlockLOS bool
|
|
|
|
BlockJump bool
|
2020-01-26 00:39:13 -05:00
|
|
|
BlockPlayerWalk bool
|
2020-04-11 14:56:47 -04:00
|
|
|
Unknown1 bool
|
|
|
|
BlockLight bool
|
|
|
|
Unknown2 bool
|
|
|
|
Unknown3 bool
|
2020-01-26 00:39:13 -05:00
|
|
|
}
|
|
|
|
|
2020-06-28 22:32:34 -04:00
|
|
|
// DebugString returns the debug string
|
2020-04-11 14:56:47 -04:00
|
|
|
func (s *SubTileFlags) DebugString() string {
|
2020-02-02 02:57:23 -05:00
|
|
|
result := ""
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.BlockWalk {
|
|
|
|
result += "BlockWalk "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.BlockLOS {
|
|
|
|
result += "BlockLOS "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.BlockJump {
|
|
|
|
result += "BlockJump "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.BlockPlayerWalk {
|
|
|
|
result += "BlockPlayerWalk "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.Unknown1 {
|
|
|
|
result += "Unknown1 "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.BlockLight {
|
|
|
|
result += "BlockLight "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.Unknown2 {
|
|
|
|
result += "Unknown2 "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
if s.Unknown3 {
|
|
|
|
result += "Unknown3 "
|
|
|
|
}
|
2020-06-28 22:32:34 -04:00
|
|
|
|
2020-02-02 02:57:23 -05:00
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2020-06-28 22:32:34 -04:00
|
|
|
// NewSubTileFlags returns a list of new subtile flags
|
|
|
|
//nolint:gomnd binary flags
|
2020-01-26 00:39:13 -05:00
|
|
|
func NewSubTileFlags(data byte) SubTileFlags {
|
|
|
|
return SubTileFlags{
|
2020-04-11 14:56:47 -04:00
|
|
|
BlockWalk: data&1 == 1,
|
|
|
|
BlockLOS: data&2 == 2,
|
|
|
|
BlockJump: data&4 == 4,
|
|
|
|
BlockPlayerWalk: data&8 == 8,
|
|
|
|
Unknown1: data&16 == 16,
|
|
|
|
BlockLight: data&32 == 32,
|
|
|
|
Unknown2: data&64 == 64,
|
|
|
|
Unknown3: data&128 == 128,
|
2020-01-26 00:39:13 -05:00
|
|
|
}
|
|
|
|
}
|