//
// GameStatsManager::countSecretChests from 0x7a621c to 0x7a6268 (76 bytes)
//
// 5 xrefs:
// > SecretRewardsLayer::updateUnlockedLabel @ 0xa61be4
// > SecretRewardsLayer::updateUnlockedLabel @ 0xa61c60
// > SecretRewardsLayer::updateUnlockedGoldLabel @ 0xa62254
// > SecretRewardsLayer::init @ 0xa63918
// > ??> @ 0x2c610
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int GameStatsManager::countSecretChests(GameStatsManager *a1, GJRewardType a2)
{
cocos2d::CCDictionary *m_allTreasureRoomChests; // x0
cocos2d::CCDictElement *m_pElements; // x3
cocos2d::CCDictElement *next; // x2
int result; // w0
cocos2d::CCObject *m_pObject; // x4
m_allTreasureRoomChests = a1->m_allTreasureRoomChests;
if ( !a2 )
return cocos2d::CCDictionary::count(m_allTreasureRoomChests);
if ( !m_allTreasureRoomChests )
return 0;
m_pElements = m_allTreasureRoomChests->m_pElements;
if ( !m_pElements )
return 0;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
result = 0;
while ( 1 )
{
m_pObject = m_pElements->m_pObject;
m_pElements = next;
if ( a2 == m_pObject[1].m_uID )
++result;
if ( !next )
break;
next = (cocos2d::CCDictElement *)next->hh.next;
}
return result;
}