2022-07-30 12:24:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-10-30 14:59:20 -04:00
|
|
|
#define CCARRAY_FOREACH_B_BASE(__array__, __obj__, __type__, __index__) \
|
|
|
|
if ((__array__) && (__array__)->count()) \
|
|
|
|
for (auto [__index__, __obj__] = std::tuple<unsigned int, __type__> { 0u, nullptr }; \
|
|
|
|
(__index__ < (__array__)->count() && \
|
|
|
|
(__obj__ = static_cast<__type__>((__array__)->objectAtIndex(__index__)))); \
|
|
|
|
__index__++)
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
#define CCARRAY_FOREACH_B_TYPE(__array__, __obj__, __type__) \
|
|
|
|
CCARRAY_FOREACH_B_BASE(__array__, __obj__, __type__*, ccArray_forEach_b_base_index)
|
|
|
|
|
|
|
|
#define CCARRAY_FOREACH_B(__array__, __obj__) \
|
|
|
|
CCARRAY_FOREACH_B_BASE(__array__, __obj__, cocos2d::CCObject*, ccArray_forEach_b_index)
|