lux/proto/lux_type.go
2024-12-29 13:35:51 +02:00

23 lines
355 B
Go

package proto
type LuxType uint
const (
LuxTypeHost = 0
LuxTypeNode
)
const LUX_PROTO_TYPE_SIZE = 2
func (luxType *LuxType) Read(rd *LuxBuffer) error {
if val, err := rd.ReadUint16(); err != nil {
return err
} else {
*luxType = LuxType(val)
return nil
}
}
func (luxType *LuxType) Write(wd *LuxBuffer) {
wd.WriteUint16(uint16(*luxType))
}