29 using namespace ::
ant;
33 phene.min_solar_altitude = -math::half_pi<float>;
34 phene.max_solar_altitude = math::half_pi<float>;
37 if (
auto element = phene_element.find(
"min_solar_altitude");
element != phene_element.end())
41 if (
auto element = phene_element.find(
"max_solar_altitude");
element != phene_element.end())
52 auto foraging_time_element = data->find(
"foraging_time");
53 if (foraging_time_element == data->end())
54 throw std::runtime_error(
"Invalid foraging time gene.");
static T * load(resource_manager *resourceManager, PHYSFS_File *file, const std::filesystem::path &path)
Loads resource data.
nlohmann::json json
JSON data.
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.
monophenic_gene< phene::foraging_time > foraging_time
Monophenic foraging time gene.
constexpr T radians(T degrees) noexcept
Converts an angle given in degrees to radians.