#pragma once /** * Codec specialisation for entt::entity. * * Wire format: uint32_t (the raw entity storage value, 4 bytes). * * EnTT entities are 32-bit identifiers internally (version bits + index bits). * We transmit the raw value and let the receiver reconstruct via * static_cast(id). */ #include "Codec.hpp" #include namespace tw::serial { template<> struct Codec { static void encode(BinaryWriter& w, const entt::entity& e) noexcept { auto raw = static_cast(e); w.write(raw); } static entt::entity decode(BinaryReader& r) noexcept { return static_cast(r.read()); } }; } // namespace tw::serial