class_name ItemOption extends PacketChunk const BYTE_LENGTH := 5 ## Byte Type: u16 ## Byte Length: 2 var index: int ## Byte Type: u16 ## Byte Length: 2 var value: int ## Byte Type: u8 ## Byte Length: 1 var parameter: int static func from_bytes(bytes: ByteStream): var option = ItemOption.new() option.index = bytes.decode_u16() option.value = bytes.decode_u16() option.parameter = bytes.decode_u8() return option static func array_from_bytes(bytes: ByteStream) -> Array[ItemOption]: var array: Array[ItemOption] = [] while bytes.available() > 0: var chunk = from_bytes(bytes) array.append(chunk) return array