diff options
| author | Léo Lam <leo@leolam.fr> | 2022-06-20 22:17:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-20 22:17:51 +0200 |
| commit | 83ae6b5d522e669c4f543223e4e4921a252bcd06 (patch) | |
| tree | 7b371b7ea2b0049d87e4eb472c560d1b37c055c4 /src/KingSystem/System/ProductReporter.cpp | |
| parent | e1c1cfe79e025e108715923ec01af06c27ddb067 (diff) | |
| parent | 4424bcfb510fe23c1199d11cf6456658ee7b78db (diff) | |
Merge pull request #94 from ConorBobbleHat/master
Switch ProductReporter::incrementSceneAndRomWorkTime to using lambdas
Diffstat (limited to 'src/KingSystem/System/ProductReporter.cpp')
| -rw-r--r-- | src/KingSystem/System/ProductReporter.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/KingSystem/System/ProductReporter.cpp b/src/KingSystem/System/ProductReporter.cpp index c6589b8b..24ddb8c8 100644 --- a/src/KingSystem/System/ProductReporter.cpp +++ b/src/KingSystem/System/ProductReporter.cpp @@ -110,8 +110,20 @@ bool ProductReporter::saveReport(PlayReport* playReport) const { return false; } -// NON_MATCHING: minor reordering & deduplication bool ProductReporter::incrementSceneAndRomWorkTime() { + const auto get_flag = [this](auto key, s32* value) { + gdt::Manager::instance()->getS32(mGameDataHandles[key], value); + }; + + const auto set_flag = [this](auto key, s32 value) { + gdt::Manager::instance()->setS32(value, mGameDataHandles[key]); + }; + + const auto increment = [this, &get_flag, &set_flag](auto key, s32* value) { + get_flag(key, value); + set_flag(key, *value + 1); + }; + if (map::PlacementMgr::instance() == nullptr) return false; |
