31 ctx.read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.eclosion_period), 1);
33 std::uint8_t cocoon_present{0};
34 ctx.read8(
reinterpret_cast<std::byte*
>(&cocoon_present), 1);
35 phene.cocoon_present =
static_cast<bool>(cocoon_present);
37 std::uint8_t cocoon_model_filename_length{0};
38 ctx.read8(
reinterpret_cast<std::byte*
>(&cocoon_model_filename_length), 1);
39 std::string cocoon_model_filename(cocoon_model_filename_length,
'\0');
40 ctx.read8(
reinterpret_cast<std::byte*
>(cocoon_model_filename.data()), cocoon_model_filename_length);
42 if (phene.cocoon_present)
53 std::unique_ptr<ant_pupa_gene> gene = std::make_unique<ant_pupa_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.
float development_period
Duration required for the pupa to develop into an adult, in days.
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.