diff --git a/libs/B-luga/include/B-luga/Json.hpp b/libs/B-luga/include/B-luga/Json.hpp index ba05526..e3704cd 100644 --- a/libs/B-luga/include/B-luga/Json.hpp +++ b/libs/B-luga/include/B-luga/Json.hpp @@ -174,6 +174,20 @@ class Json { return jsonData[index].get(); } + template + std::vector getObjectsIdInArray(const std::string &dataType, const std::string &arrayName) + { + std::vector ids; + auto data = getDataByJsonType(dataType)[arrayName]; + + for (const auto &object : data) { + if (isDataExist(object, "id")) { + ids.push_back(object["id"].get()); + } + } + return ids; + } + template T getDataByVector(const std::string &dataType, const std::vector &indexes) { diff --git a/libs/B-luga/include/B-luga/Maths/Maths.hpp b/libs/B-luga/include/B-luga/Maths/Maths.hpp index 40577da..ada13e1 100644 --- a/libs/B-luga/include/B-luga/Maths/Maths.hpp +++ b/libs/B-luga/include/B-luga/Maths/Maths.hpp @@ -7,6 +7,7 @@ #pragma once +#define _USE_MATH_DEFINES #include #include