28 using namespace ::
ant;
32 phene.model =
nullptr;
33 phene.pronotum_width = 0.0f;
34 phene.pronotum_spinescence = 0.0f;
35 phene.mesonotum_spinescence = 0.0f;
36 phene.propodeum_spinescence = 0.0f;
39 if (
auto element = phene_element.find(
"model");
element != phene_element.end())
43 if (
auto element = phene_element.find(
"pronotum_width");
element != phene_element.end())
44 phene.pronotum_width =
element->get<
float>();
47 if (
auto element = phene_element.find(
"pronotum_spinescence");
element != phene_element.end())
48 phene.pronotum_spinescence =
element->get<
float>();
51 if (
auto element = phene_element.find(
"mesonotum_spinescence");
element != phene_element.end())
52 phene.mesonotum_spinescence =
element->get<
float>();
55 if (
auto element = phene_element.find(
"propodeum_spinescence");
element != phene_element.end())
56 phene.propodeum_spinescence =
element->get<
float>();
66 auto mesosoma_element = data->find(
"mesosoma");
67 if (mesosoma_element == data->end())
68 throw std::runtime_error(
"Invalid mesosoma gene.");
static T * load(resource_manager *resourceManager, PHYSFS_File *file, const std::filesystem::path &path)
Loads resource data.
T * load(const std::filesystem::path &path)
Loads the requested resource.
nlohmann::json json
JSON data.
polyphenic_gene< phene::mesosoma > mesosoma
Polyphenic mesosoma 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.