feat: add new rule in BMapInspector
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user