mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-22 07:27:59 -05:00
deprecate global getChildOfType
This commit is contained in:
parent
63e7908413
commit
5f7008072e
2 changed files with 7 additions and 0 deletions
|
@ -1125,6 +1125,11 @@ public:
|
|||
GEODE_DLL geode::EventListenerProtocol* getEventListener(std::string const& id);
|
||||
GEODE_DLL size_t getEventListenerCount();
|
||||
|
||||
/**
|
||||
* Get nth child that is a given type. Checks bounds.
|
||||
* @returns Child at index cast to the given type,
|
||||
* or nullptr if index exceeds bounds
|
||||
*/
|
||||
template <class T = CCNode>
|
||||
T* getChildByType(int index) {
|
||||
size_t indexCounter = 0;
|
||||
|
|
|
@ -620,7 +620,9 @@ namespace geode::cocos {
|
|||
* @returns Child at index cast to the given type,
|
||||
* or nullptr if index exceeds bounds
|
||||
*/
|
||||
|
||||
template <class Type = cocos2d::CCNode>
|
||||
[[deprecated("Use CCNode::getChildByType instead")]]
|
||||
static Type* getChildOfType(cocos2d::CCNode* node, int index) {
|
||||
return node->getChildByType<Type>(index);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue