28 using namespace ::
ant;
32 phene.model =
nullptr;
34 phene.apical_dental_count = 0;
35 phene.basal_dental_count = 0;
38 if (
auto element = phene_element.find(
"model");
element != phene_element.end())
42 if (
auto element = phene_element.find(
"length");
element != phene_element.end())
43 phene.length =
element->get<
float>();
46 if (
auto element = phene_element.find(
"apical_dental_count");
element != phene_element.end())
47 phene.apical_dental_count =
element->get<
int>();
50 if (
auto element = phene_element.find(
"basal_dental_count");
element != phene_element.end())
51 phene.basal_dental_count =
element->get<
int>();
61 auto mandibles_element = data->find(
"mandibles");
62 if (mandibles_element == data->end())
63 throw std::runtime_error(
"Invalid mandibles 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::mandibles > mandibles
Polyphenic mandibles 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.