mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-07 11:27:26 -04:00
46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
#include "f/f_pc/f_pc_layer_iter.h"
|
|
#include "SComponent/c_tag_iter.h"
|
|
#include "SComponent/c_tree_iter.h"
|
|
|
|
extern "C" {
|
|
|
|
int fpcLyIt_OnlyHere(layer_class* pLayer, cNdIt_MethodFunc pFunc, void* pUserData) {
|
|
layer_iter lIter;
|
|
lIter.mpFunc = pFunc;
|
|
lIter.mpUserData = pUserData;
|
|
return cTrIt_Method(&pLayer->mNodeListTree, (cNdIt_MethodFunc)cTgIt_MethodCall, &lIter);
|
|
}
|
|
|
|
int fpcLyIt_OnlyHereLY(layer_class* pLayer, cNdIt_MethodFunc pFunc, void* pUserData) {
|
|
int result;
|
|
layer_class* currentLayer = fpcLy_CurrentLayer();
|
|
fpcLy_SetCurrentLayer(pLayer);
|
|
result = fpcLyIt_OnlyHere(pLayer, pFunc, pUserData);
|
|
fpcLy_SetCurrentLayer(currentLayer);
|
|
return result;
|
|
}
|
|
|
|
void* fpcLyIt_Judge(layer_class* pLayer, cNdIt_MethodFunc pFunc, void* pUserData) {
|
|
layer_iter lIter;
|
|
lIter.mpFunc = pFunc;
|
|
lIter.mpUserData = pUserData;
|
|
return cTrIt_Judge(&pLayer->mNodeListTree, (cNdIt_JudgeFunc)cTgIt_JudgeFilter, &lIter);
|
|
}
|
|
|
|
void* fpcLyIt_AllJudge(cNdIt_MethodFunc pFunc, void* pUserData) {
|
|
layer_iter lIter;
|
|
lIter.mpFunc = pFunc;
|
|
lIter.mpUserData = pUserData;
|
|
|
|
layer_class* current = fpcLy_RootLayer();
|
|
while (current != NULL) {
|
|
void* result =
|
|
cTrIt_Judge(¤t->mNodeListTree, (cNdIt_JudgeFunc)cTgIt_JudgeFilter, &lIter);
|
|
if (result != NULL) {
|
|
return result;
|
|
}
|
|
current = (layer_class*)current->mNode.mpNextNode;
|
|
}
|
|
return NULL;
|
|
}
|
|
} |