30 std::uint8_t present{0};
31 ctx.
read8(
reinterpret_cast<std::byte*
>(&present), 1);
32 phene.
present =
static_cast<bool>(present);
35 ctx.
read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.
length), 1);
36 ctx.
read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.
width), 1);
37 ctx.read32<std::endian::little>(
reinterpret_cast<std::byte*
>(&phene.height), 1);
39 std::uint8_t model_filename_length{0};
40 ctx.read8(
reinterpret_cast<std::byte*
>(&model_filename_length), 1);
41 std::string model_filename(model_filename_length,
'\0');
42 ctx.read8(
reinterpret_cast<std::byte*
>(model_filename.data()), model_filename_length);
55 std::unique_ptr<ant_eyes_gene> gene = std::make_unique<ant_eyes_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.
std::uint32_t ommatidia_count
Number of ommatidia.
float length
Eye length, in mesosomal lengths.
float width
Eye width, in mesosomal lengths.
bool present
Indicates whether eyes are present.
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.