27 using namespace ::
ant;
34 if (
auto element = phene_element.find(
"density");
element != phene_element.end())
35 phene.density =
element->get<
float>();
45 auto pilosity_element = data->find(
"pilosity");
46 if (pilosity_element == data->end())
47 throw std::runtime_error(
"Invalid pilosity gene.");
static T * load(resource_manager *resourceManager, PHYSFS_File *file, const std::filesystem::path &path)
Loads resource data.
nlohmann::json json
JSON data.
polyphenic_gene< phene::pilosity > pilosity
Polyphenic pilosity gene.
void deserialize_gene(monophenic_gene< T > &gene, void(*deserialize_phene)(T &, const json &, resource_manager *), const json &gene_element, resource_manager *resource_manager)
Deserializes a gene.