summaryrefslogtreecommitdiff
path: root/include/f/f_list_mg.h
blob: ff567966429cb1dfcb0b44d019368769ecbbe5ac (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_LIST_MANAGER_H
#define F_LIST_MANAGER_H

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

#include "c/c_list.h"
#include "common.h"
#include "f/f_base_id.h"
#include "f/f_list_nd.h"
#include "f/f_profile.h"

class fBase_c;

/// @brief A list of fLiNdBa_c nodes.
class fLiMgBa_c : public cListMg_c {
public:
    ~fLiMgBa_c() {}
    /**
     * @brief Counts the number of nodes of a given profile in this list.
     *
     * @param profName The profile name.
     * @return How many nodes were found.
     */
    int countNodeByProfName(ProfileName profName) const;

    const fLiNdBa_c *searchNodeByID(fBaseID_e id) const;
    const fLiNdBa_c *searchNodeByProfName(ProfileName name, fLiNdBa_c *start) const;

    inline fLiNdBa_c *getFirst() const {
        return (fLiNdBa_c *)cListMg_c::getFirst();
    }

    inline fLiNdBa_c *getLast() const {
        return (fLiNdBa_c *)cListMg_c::getLast();
    }
};

#endif