f_pc_layer (#16)

* f_op_actor_tag OK

* f_pc_layer_tag OK

* f_pc_layer_iter

* forgot a return

* identation and extern var name comments

* fix struct member name

Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
lepelog
2020-12-06 05:58:12 +01:00
committed by GitHub
parent 74faaee32a
commit ccab99f398
20 changed files with 378 additions and 754 deletions
+46 -1
View File
@@ -1 +1,46 @@
// ok
#include "f/f_pc/f_pc_layer_iter.h"
#include "SComponent/c_tree_iter.h"
#include "SComponent/c_tag_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(&current->mNodeListTree,(cNdIt_JudgeFunc) cTgIt_JudgeFilter, &lIter);
if (result != NULL) {
return result;
}
current = (layer_class*)current->mNode.mpNextNode;
}
return NULL;
}
}