summaryrefslogtreecommitdiff
path: root/include/f/f_list_mg_ptmf.h
blob: 36432b218686ed7754bf8ceab37567912b04e0d9 (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
#ifndef F_LIST_MANAGER_FUNC_H
#define F_LIST_MANAGER_FUNC_H

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

#include "common.h"
#include "f/f_list_mg.h"
#include "f/f_list_nd_prio.h"

class fBase_c;

/// @brief A list of fLiNdPrio_c nodes with a reference to a process function.
/// @note Unofficial name.
class fLiMgPTMF_c : public fLiMgBa_c {
public:
    fLiMgPTMF_c(int (fBase_c::*procFunc)()) : mpProcFunc(procFunc) {}
    void addNode(fLiNdPrio_c *node);
    bool walkPack();

    fLiNdPrio_c *getFirst() const {
        return (fLiNdPrio_c *)fLiMgBa_c::getFirst();
    }

    fLiNdPrio_c *getLast() const {
        return (fLiNdPrio_c *)fLiMgBa_c::getLast();
    }

private:
    int (fBase_c::*mpProcFunc)(); ///< The process function for the list.
};

#endif