1
0

feat: fully refactor BMapInspector rule set for better layout

This commit is contained in:
2026-03-03 17:11:30 +08:00
parent 49a729078c
commit 4c71a20935
35 changed files with 1628 additions and 1428 deletions

View File

@@ -0,0 +1,36 @@
#include "SOneRules.hpp"
#include "Shared/Utility.hpp"
namespace L = LibCmo;
namespace C = LibCmo::CK2;
namespace O = LibCmo::CK2::ObjImpls;
namespace BMapInspector::Ruleset {
#pragma region SOne Rule 1
SOneRule1::SOneRule1() : Rule::IRule() {}
SOneRule1::~SOneRule1() {}
std::u8string_view SOneRule1::GetRuleName() const {
return u8"SONE1";
}
void SOneRule1::Check(Reporter::Reporter& reporter, Map::Level& level) const {
auto* ctx = level.GetCKContext();
auto physicalized_3dobjects = Shared::Utility::FetchPhysicalized3dObjects(ctx);
for (auto* physicalized_3dobject : physicalized_3dobjects) {
auto* mesh = physicalized_3dobject->GetCurrentMesh();
if (mesh == nullptr) {
reporter.FormatError(u8"Object %s is grouped into physicalization group, but it doesn't have any associated mesh. "
u8"This will cause itself and following objects can not be physicalized.",
Shared::Utility::QuoteObjectName(physicalized_3dobject).c_str());
}
}
}
#pragma endregion
} // namespace BMapInspector::Ruleset