//
// GameStatsManager::countSecretChests from 0x10033e254 to 0x10033e298 (68 bytes)
//
// 4 xrefs:
// > SecretRewardsLayer::init @ 0x1002e8cc8
// > SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9b7c
// > SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9bcc
// > SecretRewardsLayer::updateUnlockedGoldLabel @ 0x1002e9f74
//
// 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 __fastcall GameStatsManager::countSecretChests(GameStatsManager *a1, GJRewardType a2)
{
cocos2d::CCDictionary *m_allTreasureRoomChests; // x0
cocos2d::CCDictElement *m_pElements; // x8
void *next; // x9
m_allTreasureRoomChests = a1->m_allTreasureRoomChests;
if ( a2 )
{
if ( m_allTreasureRoomChests )
{
m_pElements = m_allTreasureRoomChests->m_pElements;
if ( m_pElements )
{
LODWORD(m_allTreasureRoomChests) = 0;
do
{
next = m_pElements->hh.next;
if ( m_pElements->m_pObject[1].m_uID == a2 )
LODWORD(m_allTreasureRoomChests) = (_DWORD)m_allTreasureRoomChests + 1;
m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;
}
while ( next );
}
else
{
LODWORD(m_allTreasureRoomChests) = 0;
}
}
}
else
{
LODWORD(m_allTreasureRoomChests) = cocos2d::CCDictionary::count(m_allTreasureRoomChests);
}
return (int)m_allTreasureRoomChests;
}