1
0

feat: add new rule in BMapInspector

This commit is contained in:
2026-02-04 21:32:34 +08:00
parent 7b40c64470
commit 2240f55964
6 changed files with 95 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
#include <yycc.hpp>
#include <yycc/carton/termcolor.hpp>
#include <filesystem>
#include <cmath>
namespace termcolor = yycc::carton::termcolor;
@@ -9,12 +10,12 @@ namespace BMapInspector::Rule::Shared {
#pragma region Check Functions
/**
* @brief
* @param[in] ctx Can not be nullptr.
* @param[in] name Can not be nullptr.
* @return Found pointer to CKGroup, otherwise nullptr.
*/
bool FPEqual(L::CKFLOAT lhs, L::CKFLOAT rhs, L::CKFLOAT tolerance) {
auto diff = lhs - rhs;
auto absolute_diff = std::fabs(diff);
return absolute_diff <= tolerance;
}
O::CKGroup* FetchGroup(C::CKContext* ctx, L::CKSTRING name) {
return static_cast<O::CKGroup*>(ctx->GetObjectByNameAndClass(name, C::CK_CLASSID::CKCID_GROUP, nullptr));
}