30 std::uint8_t present{0};
31 ctx.
read8(
reinterpret_cast<std::byte*
>(&present), 1);
32 phene.
present =
static_cast<bool>(present);
37 ctx.read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.petiole_spinescence), 1);
39 std::uint8_t postpetiole_present{0};
40 ctx.read8(
reinterpret_cast<std::byte*
>(&postpetiole_present), 1);
41 phene.postpetiole_present =
static_cast<bool>(postpetiole_present);
43 ctx.read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.postpetiole_length), 1);
44 ctx.read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.postpetiole_width), 1);
45 ctx.read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.postpetiole_height), 1);
46 ctx.read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.postpetiole_spinescence), 1);
48 std::uint8_t model_filename_length{0};
49 ctx.read8(
reinterpret_cast<std::byte*
>(&model_filename_length), 1);
50 std::string model_filename(model_filename_length,
'\0');
51 ctx.read8(
reinterpret_cast<std::byte*
>(model_filename.data()), model_filename_length);
64 std::unique_ptr<ant_waist_gene> gene = std::make_unique<ant_waist_gene>();
void load_ant_gene(ant_gene< T > &gene, resource_manager &resource_manager, deserialize_context &ctx, void(*load_phene)(T &, ::resource_manager &, deserialize_context &))
Loads an ant gene.
static std::unique_ptr< T > load(::resource_manager &resource_manager, deserialize_context &ctx)
Loads a resource.
Manages the loading, caching, and saving of resources.
std::shared_ptr< T > load(const std::filesystem::path &path)
Loads and caches a resource.
Trait that describes the waist (petiole plus postpetiole) of an ant.
float petiole_width
Petiole width, in mesosomal lengths.
float petiole_height
Petiole height, in mesosomal lengths.
float petiole_length
Petiole length, in mesosomal lengths.
Provides access to a deserialization state.
std::size_t read32(std::byte *data, std::size_t count) noexcept(false)
Reads 32-bit (double word) data.
virtual std::size_t read8(std::byte *data, std::size_t count) noexcept(false)=0
Reads 8-bit (byte) data.