//
// Generated by dtk
// Translation Unit: c_node_iter.cpp
//

#include "SSystem/SComponent/c_node_iter.h"
#include "SSystem/SComponent/c_node.h"
#include "dolphin/types.h"

/* 80244EB4-80244F44       .text cNdIt_Method__FP10node_classPFP10node_classPv_iPv */
BOOL cNdIt_Method(node_class* pNode, cNdIt_MethodFunc pMethod, void* pUserData) {
    BOOL ret = TRUE;
    node_class* pNext = NODE_GET_NEXT(pNode);

    while (pNode) {
        int methodRet = pMethod(pNode, pUserData);
        if (!methodRet)
            ret = FALSE;
        pNode = pNext;
        pNext = NODE_GET_NEXT(pNext);
    }

    return ret;
}

/* 80244F44-80244FD0       .text cNdIt_Judge__FP10node_classPFP10node_classPv_PvPv */
void* cNdIt_Judge(node_class* pNode, cNdIt_JudgeFunc pJudge, void* pUserData) {
    node_class* pNext = NODE_GET_NEXT(pNode);

    while (pNode) {
        void* pJudgeRet = pJudge(pNode, pUserData);
        if (pJudgeRet != NULL)
            return pJudgeRet;
        pNode = pNext;
        pNext = NODE_GET_NEXT(pNext);
    }

    return NULL;
}
