Class CCDictionaryExt<Key, ValueInpT, Retain>

#include <Geode/utils/cocos.hpp>
template<class Key = std::string_view,class ValueInpT = cocos2d::CCObject>classCCDictionaryExt{ ... }

A templated wrapper over CCDictionary, providing easy iteration and indexing. This will keep ownership of the given CCDictionary*.

Template parameters

Key

Type of the key. MUST be one of: int, std::string_view (recommended), gd::string, std::string.

ValuePtr

Pointer to a type that inherits CCObject.
Examples1
CCDictionaryExt<std::string_view, GJGameLevel*> levels = getSomeDict();
// Easy indexing, giving you the type you assigned
GJGameLevel* myLvl = levels["Cube Adventures"];

// Easy iteration using C++ range-based for loops
for (auto [name, level] : levels) {
  log::info("{}: {}", name, level->m_levelID);
}
Public static methods0
Public member functions9
template<CocosDictionaryKey MapKey>voidCCDictionaryExt<Key, ValueInpT, Retain>()
No description provided
autobegin()
No description provided
autoend()
No description provided
size_tsize()
No description provided
geode::cocos::CCDictionaryExt::Entryoperator[]()
No description provided
boolcontains()
No description provided
size_tcount()
No description provided
cocos2d::CCDictionary*inner()
No description provided
boolempty()const
No description provided
Fields0
Protected member functions0
Protected fields1
;
No description provided
Derived classes0