mirror of
https://github.com/projectPiki/pikmin2.git
synced 2024-12-01 01:00:33 +00:00
393dcd1dba
requested by @intns
67 lines
1.2 KiB
C
67 lines
1.2 KiB
C
#ifndef _CNODE_H
|
|
#define _CNODE_H
|
|
|
|
#include "types.h"
|
|
|
|
struct CNode {
|
|
CNode();
|
|
inline CNode(char* name)
|
|
{
|
|
mChild = nullptr;
|
|
mParent = nullptr;
|
|
mPrev = nullptr;
|
|
mNext = nullptr;
|
|
mName = name;
|
|
};
|
|
|
|
virtual ~CNode(); // _08
|
|
virtual int getChildCount(); // _0C
|
|
|
|
int calcNextCount();
|
|
CNode* getChildAt(int);
|
|
|
|
void add(CNode*);
|
|
void addHead(CNode*);
|
|
void concat(CNode*);
|
|
void del();
|
|
|
|
/**
|
|
* @reifiedAddress{8013917C}
|
|
* @reifiedFile{plugProjectKandoU/collinfo.cpp}
|
|
*/
|
|
void setName(char* name) { mName = name; }
|
|
|
|
/**
|
|
* @fabricated
|
|
*/
|
|
inline void clearRelations()
|
|
{
|
|
mChild = nullptr;
|
|
mParent = nullptr;
|
|
mPrev = nullptr;
|
|
mNext = nullptr;
|
|
}
|
|
|
|
/**
|
|
* @fabricated
|
|
*/
|
|
inline void reset(char* name)
|
|
{
|
|
clearRelations();
|
|
setName(name);
|
|
}
|
|
|
|
// _00 vtbl
|
|
CNode* mNext; // _04
|
|
CNode* mPrev; // _08
|
|
CNode* mParent; // _0C
|
|
CNode* mChild; // _10
|
|
const char* mName; // _14
|
|
};
|
|
|
|
#define FOREACH_NODE(type, first, varname) for (type* varname = (type*)(first); varname != nullptr; varname = (type*)(varname->mNext))
|
|
#define FOREACH_NODE_EX(type, first, varname, excond) \
|
|
for (type* varname = (type*)(first); varname != nullptr && (excond); varname = (type*)(varname->mNext))
|
|
|
|
#endif
|