summaryrefslogtreecommitdiff
path: root/include/f/f_tree_mg.h
blob: 3988aedcbcb211f047cc8d1382de849bcfaf2379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef F_TREE_MANAGER_H
#define F_TREE_MANAGER_H

// This file was ported from
// https://github.com/NSMBW-Community/NSMBW-Decomp/blob/master/include/dol/framework/f_tree_mg.hpp

#include "c/c_tree.h"
#include "common.h"
#include "f/f_profile.h"


class fTrNdBa_c;

/// @brief A container for a tree of fTrNdBa_c nodes.
class fTrMgBa_c : public cTreeMg_c {
public:
    /**
     * @brief Finds a node with a given profile name, optionally under a given parent root node.
     *
     * @param profName The profile name.
     * @param parent The root node to start search below, or @p nullptr to use the tree's root node.
     * @return The found node, or @p nullptr if none was found.
     */
    const fTrNdBa_c *searchNodeByProfName(ProfileName profName, const fTrNdBa_c *parent) const;
    /**
     * @brief Find a node with a given group type, optionally under a given parent root node.
     *
     * @param groupType The group type.
     * @param parent The root node to start search below, or @p nullptr to use the tree's root node.
     * @return The found node, or @p nullptr if none was found.
     */
    const fTrNdBa_c *searchNodeByGroupType(u8 groupType, const fTrNdBa_c *parent) const;

    const fTrNdBa_c *getRoot() const {
        return (fTrNdBa_c *)cTreeMg_c::getRoot();
    }
};

#endif