27 using namespace ::
ant;
31 phene.min_mesosoma_length = 1.0f;
32 phene.max_mesosoma_length = 1.0f;
33 phene.mean_mesosoma_length = 1.0f;
36 if (
auto element = phene_element.find(
"min_mesosoma_length");
element != phene_element.end())
37 phene.min_mesosoma_length =
element->get<
float>();
40 if (
auto element = phene_element.find(
"max_mesosoma_length");
element != phene_element.end())
41 phene.max_mesosoma_length =
element->get<
float>();
44 if (
auto element = phene_element.find(
"mean_mesosoma_length");
element != phene_element.end())
45 phene.mean_mesosoma_length =
element->get<
float>();
55 auto body_size_element = data->find(
"body_size");
56 if (body_size_element == data->end())
57 throw std::runtime_error(
"Invalid body size 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::body_size > body_size
Polyphenic body size 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.