class_name RegularItemInformation extends PacketChunk const BYTE_LENGTH := 22 ## Byte Type: u16 ## Byte Length: 2 var index: int ## Byte Type: u32 ## Byte Length: 4 var item_id: int ## Byte Type: u8 ## Byte Length: 1 var item_type: int ## Byte Type: u16 ## Byte Length: 2 var amount: int ## Byte Type: u32 ## Byte Length: 4 var equipped_position: int ## Byte Type: u32 ## Byte Length: 4 * 4 var slot: PackedByteArray ## Byte Type: u32 ## Byte Length: 4 var hire_expiration_date: int ## Byte Type: u8 ## Byte Length: 1 var flags: int static func from_bytes(bytes: ByteStream): var info = RegularItemInformation.new() info.index = bytes.decode_u16() info.item_id = bytes.decode_u32() info.item_type = bytes.decode_u8() info.amount = bytes.decode_u16() info.equipped_position = bytes.decode_u32() info.slot = bytes.get_buffer(4 * 4).bytes info.hire_expiration_date = bytes.decode_u32() info.flags = bytes.decode_u8() return info static func array_from_bytes(bytes: ByteStream) -> Array[RegularItemInformation]: var array: Array[RegularItemInformation] = [] while bytes.available() > 0: var chunk = from_bytes(bytes) array.append(chunk) return array