| 11 | // In n out events |
| 12 | |
| 13 | Result<CounterChangeEvent> CounterChangeEvent::decode(ByteReader& reader) { |
| 14 | uint64_t rawData = READER_UNWRAP(reader.readU64()); |
| 15 | |
| 16 | uint8_t rawType = (rawData >> 56) & 0xff; |
| 17 | uint32_t itemId = (rawData >> 32) & 0x00fffff; |
| 18 | uint32_t value = static_cast<uint32_t>(rawData & 0xffffffffULL); |
| 19 | |
| 20 | return Ok(CounterChangeEvent { |
| 21 | rawType, itemId, value |
| 22 | }); |
| 23 | } |
| 24 | |
| 25 | Result<> CounterChangeEvent::encode(HeapByteWriter& writer) { |
| 26 | writer.writeU16(EVENT_COUNTER_CHANGE); |
nothing calls this directly
no test coverage detected